>>>>>I'm using gcc 4.0. By looking inside float.h i only see the following:
>>>>>#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__
[quoted text clipped - 17 lines]
> Look a bit closer and you'll see that's in an #if __MWERKS__ block.
> It's only there for CodeWarrior support.
> >>>>>I'm using gcc 4.0. By looking inside float.h i only see the following:
> >>>>>#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__
[quoted text clipped - 24 lines]
> > prussell$ gcc-3.3 -E -dM - < /dev/null | grep __LDBL_MIN_10_EXP__
> > #define __LDBL_MIN_10_EXP__ (-307)
I wonder if the different value is due to the different default size of
long double between 3.3 and 4.0. Long double technically wasn't
supported on Mac OS X until 128-bit long doubles were introduced with
gcc 4 and Tiger. Each compiler may be correct for its long double size.
This example shows, well, something:
PowerBookG412:~> cat test.c
#include <stdio.h>
int main(void) {
printf("Size of long double: %lu\n", sizeof(long double));
return 0;
}
PowerBookG412:~> gcc-3.3 -Wall -g -o test test.c
test.c: In function `main':
test.c:4: warning: use of `long double' type; its size may change in a
future release
test.c:4: warning: (Long double usage is reported only once for each
file.
test.c:4: warning: To disable this warning, use -Wno-long-double.)
PowerBookG412:~> ./test
Size of long double: 8
PowerBookG412:~> gcc-4.0 -Wall -g -o test test.c
PowerBookG412:~> ./test
Size of long double: 16
PowerBookG412:~>
-Eric

Signature
Eric Albert ejalbert@cs.stanford.edu
http://outofcheese.org/
Paul Russell - 31 Dec 2005 09:50 GMT
>>>>>>>I'm using gcc 4.0. By looking inside float.h i only see the following:
>>>>>>>#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__
[quoted text clipped - 52 lines]
> Size of long double: 16
> PowerBookG412:~>
I can only guess, than, that some of the negative exponent range in long
double has been stolen for NANs and other special cases, and the change
in gcc 4.0 reflects this ?
Paul