Questions about NCEG
Paul Eggert
eggert at twinsun.com
Fri Jun 1 04:00:33 AEST 1990
Andrew P. Mullhaupt asks (re `#define infinity (1e300*1e300)'):
Will this work if the compiler supports IEEE extended format for constants?
In theory, yes. In practice, no. I'd prefer
#define infinity (1.0/0.0)
which should work on ANSI C + IEEE 754 implementations regardless of format.
However, some compilers balk at `1.0/0.0'. `1e300*1e300' works on all IEEE 754
implementations that I know of, and also gets through the broken compilers.
More information about the Comp.std.c
mailing list