X-Authentication-Warning: acp3bf.physik.rwth-aachen.de: broeker owned process doing -bs Date: Mon, 20 Mar 2000 15:15:28 +0100 (MET) From: Hans-Bernhard Broeker X-Sender: broeker AT acp3bf To: djgpp-workers AT delorie DOT com Subject: Re: Unnormals??? In-Reply-To: <38D24CB0.7BA8FEB7@cyberoptics.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Fri, 17 Mar 2000, Eric Rudd wrote: > Hans-Bernhard Broeker wrote: > There is the cryptic statement in the Pentium Pro manual, vol. 2, 7.6: > > "The sign bit of a NaN is not interpreted." > > What do you suppose they mean by that? Without some more context, I'ld have to guess wildly. I prefer not to do that, unless there's nothing else left to do... > > The C99 explicitly mentions signs of NaNs in its output specification for > > *printf(), and also in strtod()/*scanf() input. I don't think we can just > > say the a NaN with the sign bit set is *not* negative. > > Yes, by footnote 220 > > 7.19.6.1 Library 7.19.6.1 > > 220When applied to infinite and NaN values, the -, +, and > space flag characters have their usual meaning; the # and > 0 flag characters have no effect. This, being a footnote, is not 'normative', so it doesn't mean anything of consequence. The explanation of the '+' option, however, does. Curiously enough, that's the single place in the document I could find where the behaviour of the optional minus sign is explicitly defined, for the case where the "+" option is not given. So the central question remains this one: Is a NaN with the sign bit to be considered 'negative', in terms of the C99 document, or not. My point of view: Yes, it is negative. If not by setting the sign bit, what *else* could make a NaN negative? Or, if no NaN can ever be negative, why would C99 explicitly allow output like "-nan", in the first place? Eli's point of view, as I read it: No, it is not negative, because the term 'negative' does not have a valid mathematical meaning for NaNs. My point against this reasoning by Eli is that the word 'negative', if found in the C99 standard, does not necessarily mean the same as the word 'negative' in mathematics. Particularly in the case of NaNs, which live completely outside the realm of analysis and algebra, such mathematical arguments don't really count. Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.