[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Scheme-reports] multiple NaN values

IEEE allows multiple NaN values.  They're unlikely to matter
for Scheme implementations or code, but I think a note is in order.

I suggest something like the following:

IEEE 754 specifies multiple NaN values.  A Scheme implementation
may collapse all NaN values to a single "representative NaN",
or there may be multiple NaN values.  In the latter case,
the +nan.0 is the "canonical NaN" value.  Scheme functions in
general must treat all NaN values as equivalent. This specifically includes
the nan? functions, which must be true for all NaN values.
The only standard Scheme function which can distingish
different  NaN values is eqv?, though it is also permitted to
treat all NaN values as eqv?

Or perhaps:

IEEE 754 specifies multiple NaN values.  Scheme generally does
not care if there is a single value (bit pattern) for NaN,
or if there are multiple values:  If there are multiple NaN
values, or just one, they are all equivalent in terms of Scheme
computation: If there are multiple NaN values, they are all =.
However, the eqv? function is permitted (but not required)
to return #f when given two different NaN values.
	--Per Bothner
per@x   http://per.bothner.com/

Scheme-reports mailing list