[r6rs-discuss] response to formal comment 8 [equality predicates
and NaN]
Alan Watson
alan at alan-watson.org
Thu Jan 4 12:09:10 EST 2007
Per Bothner wrote:
> > For example, a system with delayed boxing of
> > inexact real numbers may box the two arguments to eqv?
> > separately, the boxing process may involve a change of
> > precision, and the two separate changes of precision may
> > result in two different payloads.
>
> I really can't visualize how this could be. If two unboxed
> flonums have the same precision, representation, and bit-pattern,
> how could any sane implementation box them into two values
> with different precision?
Indeed. I understand that the IEEE spec allows great freedom in this
area, but does anyone know of real hardware or a real Scheme
implementation that behaves in this way?
If such a system did exist, an alternative might be to make all NaNs
eqv?, even if they have different payloads. This would guarantee that
(let ((x ...)) (eqv? x x)) was true for all numbers.
Regards,
Alan
More information about the r6rs-discuss
mailing list