floating point constants

Doug Gwyn gwyn at smoke.BRL.MIL
Thu Jul 27 01:23:10 AEST 1989


In article <1925 at arisia.Xerox.COM> leisner at arisia.Xerox.COM (Marty Leisner) writes:
>Is this a valid C program?

It's certainly not strictly conforming.  Division by zero is handled in
an implementation-dependent way, including fatal compile-time error.

Some of us think the IEEE inf/Nan scheme is conceptually bogus anyway.
However, given that you seem to have a use for these in your (non-portable)
application, the only way I know of to safely obtain inf and NaN quantities
is to do it at run time, not compile time.  In your example that means not
computing the quantities by some constant expression, but by one involving
variables.



More information about the Comp.lang.c mailing list