Tuesday, June 10, 2008

-DBL_MAX

$ cat neg_dbl_max.c
#include <float.h>
#include <stdio.h>

int main()
{
printf("%.50g\n", -DBL_MAX);
return 0;
}
$ gcc -Wall neg_dbl_max.c
$ ./a.out
-1.7976931348623157081452742373170435679807056752584e+308
(This is running under Mac OS X 10.4 on an Intel Mac.) It'd be cool if gcc would recognize this constant and print it instead.

No comments: