Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!uxc.cso.uiuc.edu!uxc.cso.uiuc.edu!gistdev!flint From: flint@gistdev.UUCP Newsgroups: comp.unix.wizards Subject: Re: what does NaN mean out of printf? Message-ID: <8800025@gistdev> Date: 19 Jul 89 18:02:00 GMT References: <20283@adm.BRL.MIL> Lines: 11 Nf-ID: #R:adm.BRL.MIL:20283:gistdev:8800025:000:571 Nf-From: gistdev.UUCP!flint Jul 19 13:02:00 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@uxc.cso.uiuc.edu UUCP: {uunet,pur-ee,convex}!uiucuxc!gistdev!flint