This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: double and float in GCC
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Kondi <konrad dot p dot wojciechowski at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 23 Jun 2016 08:39:55 -0500
- Subject: Re: double and float in GCC
- Authentication-results: sourceware.org; auth=none
- References: <1466672618384-1275275 dot post at n5 dot nabble dot com>
On Thu, Jun 23, 2016 at 02:03:38AM -0700, Kondi wrote:
> I built GCC toolchain for my custom CPU. My custom CPU have 32-bits floating
> point unit so I set DOUBLE_TYPE_SIZE 32, to prevent convertion from float to
> double. Additionally in newlib I define _DOUBLE_IS_32BITS.
> When I ran the GCC test, buildin-math-4.c fails and exactly:
>
> if (sizeof(int)*__CHAR_BIT__ <= __DBL_MANT_DIG__) {
> The IF condition is met,
Assuming your ints are 32 bits (and your __CHAR_BIT__ is 8), this means
your __DBL_MANT_DIG__ is bigger than 32. That's not consistent.
Segher