what does NaN mean out of printf?

flint at gistdev.UUCP flint at gistdev.UUCP
Thu Jul 20 04:02:00 AEST 1989


NaN is not a number.  An easy way to get that is having a union, or by
doing a cast (of a long to a float) when you shouldn't.  For example, the
bit pattern for the integer -1L (all bits set) does not correspond to any
legal floating point value.  SYS V has an isnan(3C) function to test if a
value is legal floating point without generating an exeception. 

Flint Pellett, Global Information Systems Technology, Inc.
1800 Woodfield Drive, Savoy, IL  61874     (217) 352-1165
INTERNET: flint%gistdev at uxc.cso.uiuc.edu
UUCP:     {uunet,pur-ee,convex}!uiucuxc!gistdev!flint



More information about the Comp.unix.wizards mailing list