Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!spool.mu.edu!uunet!mcsun!ukc!edcastle!aiai!richard From: richard@aiai.ed.ac.uk (Richard Tobin) Newsgroups: comp.lang.c Subject: Re: need isnan and isinf src for microsoft c Message-ID: <4566@skye.ed.ac.uk> Date: 29 Apr 91 15:19:15 GMT References: <1991Apr22.173940.25021@solo.csci.unt.edu> Reply-To: richard@aiai.UUCP (Richard Tobin) Organization: AIAI, University of Edinburgh, Scotland Lines: 19 In article <1991Apr22.173940.25021@solo.csci.unt.edu> gene@ponder.csci.unt.edu (Gene De Lisa) writes: >Could someone tell me how to detect NaN and infinite numbers Infinities have the exponent set to its maximum value and the mantissa zero. NaNs have the same exponent but a non-zero mantissa. For single precision the format is sign bit, 8 bit exponent, 23 bit mantissa. For double precision the numbers are 11 and 52. >in microsoft c? Assuming it uses IEEE format, as above, but you have to be careful about byte order. -- Richard -- Richard Tobin, JANET: R.Tobin@uk.ac.ed AI Applications Institute, ARPA: R.Tobin%uk.ac.ed@nsfnet-relay.ac.uk Edinburgh University. UUCP: ...!ukc!ed.ac.uk!R.Tobin