Newsgroups: comp.lang.c Path: utzoo!utgpu!sarathy From: sarathy@gpu.utcs.utoronto.ca (Rajiv Sarathy) Subject: Re: Not A Number in IEEE Math Message-ID: <1990Feb19.172558.29696@gpu.utcs.utoronto.ca> Keywords: IEEE floating point Organization: UTCS Public Access References: <44@newave.UUCP> Date: Mon, 19 Feb 90 17:25:58 GMT In article <44@newave.UUCP> john@newave.UUCP (John A. Weeks III) writes: > >My understanding of the NaN (not a number) value in IEEE math is >that once you get NaN, the operators +, -, /, *, and = are supposed >to propagate the NaN value. Is my understanding correct? > >Well, while using MetaWare's HIGH-C compiler for the 80386 chip, I >have discovered that: > > NaN / NaN = 1.0 > > and > > 0.0 * NaN = 0.0. > >Is this correct behavior? I think HIGH-C is broken... As long as only very, VERY, large numbers (positive or negative) are defined to be NaNs (ie. not results of division by zero, and other silly things), then the above behaviour makes sense. Mathematically: lim __n__ = 1.0 and lim 0.0 * n = 0.0 n->inf n n->inf where inf is +/- infinity. Unfortunately, NaNs encompass other floating-point exceptions as well, on some machines. -- Rajiv Partha Sarathy _ _ /^\ INTERNET sarathy@gpu.utcs.utoronto.ca ................ooooooooOOOO(_)(_)\_/ BITNET sarathy@utorgpu.bitnet University Of Toronto Computing Services UUCP sarathy@utgpu.uucp