Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!mips!ardent!mac From: mac@ardent.com Newsgroups: comp.lang.c Subject: Re: Not A Number in IEEE Math Message-ID: Date: 19 Feb 90 21:38:44 GMT References: <44@newave.UUCP> Sender: news@ardent.UUCP Reply-To: mac@ardent.com (Michael McNamara) Followup-To: comp.lang.c Organization: Ardent Computer Corporation, Sunnyvale, CA Lines: 35 In-reply-to: john@newave.UUCP's message of 16 Feb 90 05:13:29 GMT In article <44@newave.UUCP> john@newave.UUCP (John A. Weeks III) writes: > Xref: ardent comp.lang.c:24861 comp.sys.ibm.pc.programmer:25 ^ why ardent? > 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... > > -john- This behaviour is not correct. Possibly the compiler has folied you by presubstituting 1.0 for A/A and 0.0 for 0.0 * A at compile time. Or, perhaps your hardware traps into the OS for IEEE exceptions and the OS's handling of source exceptions is broken. Or, perhaps your hardware is not IEEE compliant.... -- Michael McNamara (St)ardent, Inc. mac@ardent.com