chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] EQV? and NaN


From: John Cowan
Subject: Re: [Chicken-users] EQV? and NaN
Date: Wed, 13 Jul 2011 18:56:34 -0400
User-agent: Mutt/1.5.18 (2008-05-17)

Aleksej Saushev scripsit:

> Two different NaNs are _not_ the same, and there exist at least two
> different NaNs (signalling and quiet, see IEEE 754). Two different
> signalling NaNs are _not_ the same, since they encode _different_
> events.  At least the _may_ be different.

You are correct in principle: however, C does not support signaling
NaNs, and there is no portable way to turn on FP exception handling.
When handing is off, all NaNs are in effect quiet.

Nor is there any portable way to retrieve the other bits of a NaN,
short of casting it to a 64-bit integer quantity.  Nor are there any
guarantees as to what those bits might mean.

So in practice there is only one NaN value.

> Given that "-nan.0" returns "+nan.0" this should be quiet NaN, right?
> There may exist two different ways to get "+nan.0" and these may be
> different per standard.

Numerically all NaNs are unequal; that is, = always returns false when
one argument is a NaN.  The question is what is the Right Thing to do
when NaN is considered as a Scheme object.

-- 
Andrew Watt on Microsoft:                       John Cowan
Never in the field of human computing           address@hidden
has so much been paid by so many                http://www.ccil.org/~cowan
to so few! (pace Winston Churchill)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]