C++ digraph <>
Thomas M. Breuel
uunet!ai.mit.edu!tmb
Sat Dec 7 14:17:02 PST 1991
rmsagnu.ai.mit.edu writes:
|[provide primitives for detecting NaN's and infinities]
|I seem to recall that x == x serves for one of these primitives. So
|we need just one series of built-in functions, one for each type, to
|serve for the other. This makes three functions, for the three
|floating types. I don't think that constitutes a serious problem.
Where is the behavior of "==" and "!=" on NaN's actually defined?
Am I the only one that thinks that it is a bad idea that there
exists any x for which "x!=x" is true?
I completely agree with RMS that the best way for dealing with
IEEE floating point numbers is to provide functions/macros to
detect NaN's and infinities.
This has the advantage that it makes it obvious to the reader that some
IEEE feature is being used, it can be implemented without modifications
to existing compilers, and it does not in any way affect the semantics
of the existing comparison operators (whose effect on NaN's and
infinities should simply be undefined).
Thomas.
More information about the Numeric-interest
mailing list