[scheme-reports-wg1] Inexact numbers and `eqv?`: the post I didn't want to make
John Cowan 26 Nov 2012 02:00 UTC
I thought hard before making this post, because I hate allowing material
non-public information to affect a standards process, and especially
when the information is about intentions rather than present facts --
life is short, and we all change our minds.
But I have been told by one Scheme implementer that he plans to add
a second, non-floating-point, type of inexact numbers to his Scheme.
Insofar as I understand the mathematics of them -- which is only slightly
more than not at all -- there will be no negative zero or NaN(s), and
perhaps no infinities either. But there will (I think) be more than
one possible representation of a given number.
For this sort of non-IEEE exact number, = is the Right Thing for `eqv?`.
There are no special cases of numbers that should be distinguished even
though they are not mathematically equal. However, there is (I think)
more than one representation for a given mathematical number, so a
"same-bits" standard will not work either: it will create unpredictable
fluctuations in the use of `eqv?`, such that in principle
(eqv? (+ 1.0 3.0) (+ 2.0 2.0)) might be #f, because the representation
of a number depends on how it is computed.
So there it is; make of it what you will. (The implementer is reading
this, though not in advance; I would urge him not to reveal himself,
as I think it will cause more difficulties for the WG than it solves.)
--
Is a chair finely made tragic or comic? Is the John Cowan
portrait of Mona Lisa good if I desire to see cowan@ccil.org
it? Is the bust of Sir Philip Crampton lyrical, http://ccil.org/~cowan
epical or dramatic? If a man hacking in fury
at a block of wood make there an image of a cow,
is that image a work of art? If not, why not? --Stephen Dedalus