Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!hplabs!nsc!taux01!yuval From: yuval@taux01.UUCP (Gideon Yuval) Newsgroups: comp.arch Subject: Re: 88k trick for FP abs/neg Message-ID: <813@taux01.UUCP> Date: 7 Jul 88 08:34:06 GMT References: <10136@tekecs.TEK.COM> <2553@obiwan.mips.COM> Reply-To: yuval@taux01.UUCP (Gideon Yuval) Organization: National Semiconductor (Israel) Ltd. Lines: 16 > Oughtn't the operand be first tested for "IEEE-ness"? Specifically, > what if the operand of neg is a Signaling NaN? Oughtn't this cause > an invalid operation exception? The "Recommended Functions & Predicates" section of the standard has: "-x is x copied with its sign reversed, not 0-x; the distinction is germane when x is +-0 or NaN." From this, the obvious conclusion is that -NaN is that same NaN with its sign reversed. Same goes for abs(x); "abs(x)=copysign(x,1.0), even if x is a NaN". -- Gideon Yuval, yuval@taux01.nsc.com, +972-2-690992 (home) ,-52-522255(work) Paper-mail: National Semiconductor, 6 Maskit St., Herzliyah, Israel (alternative E-mail address: decwrl!nsc!taux01!yuval@uunet.uu.net)