This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: infinity != infinity
- From: Andreas Schwab <schwab at suse dot de>
- To: amylaar at spamcop dot net (Joern Rennecke)
- Cc: weigand at i1 dot informatik dot uni-erlangen dot de (Ulrich Weigand),joern dot rennecke at superh dot com, gcc at gcc dot gnu dot org
- Date: Sat, 10 Jul 2004 14:35:04 +0200
- Subject: Re: infinity != infinity
- References: <20040710052726.41669116B16@meolyon.local>
amylaar@spamcop.net (Joern Rennecke) writes:
>> The standard is apparently less than explicit on this particular point.
>> But e.g. http://compilers.iecc.com/comparch/article/98-07-108
>> says the intent was that infinity was supposed to compare equal with
>> itself:
>>
>> > To remove doubt as to the intent: In an implementation guide to a draft
>> > version of the standard, Coonen [_Computer_, 13: 1, p. 78] gives a table
>> > which clearly shows that +oo = +oo and -oo = -oo are to be TRUE.
>
> But the question remains, was this derived from his note of the standards
> commitee meetings, or from his personal interpretation of the standard
> (or maybe even his preconception of what it should be) ?
There is a strong indication of the intent of the standard in Appendix A
(not normative) of IEEE 754:
7. Isnan(y), or equivalently x != x, returns the value TRUE if x is a
NaN, and returns FALSE otherwise.
Also, the standard only talks about unordered relations in connection with
NaNs.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."