[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] EQV? on numbers should be based on operational equivalence
On Mon, May 7, 2012 at 7:07 PM, Mark H Weaver <mhw@x>
What about NaNs? If we allow (eqv? +nan.0 +nan.0) => #false for NaNs
with the same bit patterns, then memoization tables would accumulate
redundant entries for NaN arguments. I would argue that although we
cannot mandate a specific answer for (eqv? +nan.0 +nan.0), we should
mandate that the answer be consistent with operational equivalence. On
IEEE 754 platforms, this implies that the result should be #true if both
NaNs have the same bit patterns, and #false for NaNs with different bit
patterns if they are distinguishable by standard numerical procedures.
What do you think?
Thanks for your detailed description. I personally agree warmly with you, with the emphasis that some implementations may choose to have only one bit pattern value for NaN if they wish, instead of managing all possible values.
Scheme-reports mailing list