Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!mips!pacbell.com!pacbell!att!dptg!ulysses!andante!alice!ark From: ark@alice.UUCP (Andrew Koenig) Newsgroups: comp.lang.c Subject: Re: Floating point exceptions Keywords: NAN, Infinity Message-ID: <11142@alice.UUCP> Date: 4 Aug 90 14:18:29 GMT References: <446@demott.COM> Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 17 In article <446@demott.COM>, kdq@demott.COM (Kevin D. Quitt) writes: > I need to be able to examine an IEEE double to see if it is anything > but a number (e.g. NAN) *before* I actually try to use it. If your implementation is nice to you, you will have some library function like isNaN(). If not, then you're supposed to be able to turn traps off and (I think) check whether the number is equal to itself (!) -- I believe that all six relational operators are supposed to return `false' if either operand is a NaN. If you have a signalling NaN, though, you'd better make sure you turn traps off. -- --Andrew Koenig ark@europa.att.com