Re: [Scheme-reports] EQV? on numbers should be based on operational equivalence
John Cowan 08 May 2012 07:34 UTC
Mark H Weaver scripsit:
> Are you sure that all NaNs are operationally equivalent? IEEE 754
> defines two different kinds of NaN: quiet NaNs and signalling NaNs.
Yes. However, in practice no operation returns a signaling NaN unless
at least one argument is a signaling NaN, and even then it may trap
rather than return one. I also found out that different chips disagree
on the meaning of the quiet/signaling bit: on most procesors 1 means
quiet, but on the PA-RISC and MIPS chips it means signaling, since IEEE 754:1985
was silent on the point.
> Keep in mind that any operation involving NaNs that the standard leaves
> unspecified is a place where a conforming implementation might
> distinguish between NaNs with different bit patterns.
In principle.
> > R6RS mandates that, but R7RS currently leaves it unspecified.
>
> How would you suggest implementing memoization in a portable R7RS
> program?
Actually, both draft 6 and the current draft say (in section 6.2.4)
that 0.0 and -0.0 are distinct to EQV? if they are distinct at all.
I didn't remember that until today.
--
XQuery Blueberry DOM John Cowan
Entity parser dot-com cowan@ccil.org
Abstract schemata http://www.ccil.org/~cowan
XPointer errata
Infoset Unicode BOM --Richard Tobin
_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports