[comp.lang.c] what does NaN mean out of printf?

gwyn@smoke.BRL.MIL (Doug Gwyn) (07/19/89)

In article <20283@adm.BRL.MIL> Leisner.Henr@xerox.com (Marty) writes:
>What does NaN mean out of printf?

Please direct C language questions to the C newsgroup, not a UNIX group.

NaN stands for "Not a Number".  In IEEE Std 754/854 floating-point
arithmetic, there are a set of bit combinations reserved for representing
non-numbers, as well as values for positive and negative infinity.
If you haven't arranged your computation correctly, you can easily find
one of these odd creatures lurking in a floating-point variable instead
of a valid number.