[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] multiple NaN values
On 02/20/2012 09:12 AM, Aubrey Jaffer wrote:
> | Date: Mon, 20 Feb 2012 01:07:09 -0800
> | From: Per Bothner<per@x>
> | 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?
> EQ? is allowed to distinguish different NaN values. It is better to
> let EQ? make this distinction than EQV?.
EQ? can distinguish the "same" values as being different:
(eq? 2.0 2.0) => unspecified.
Thus it is uninteresting in this context.
Scheme-reports mailing list