Mark S. Miller
erights at google.com
Thu Sep 18 18:03:16 PDT 2008
On Thu, Sep 18, 2008 at 5:22 PM, Maciej Stachowiak <mjs at apple.com> wrote:
> On Sep 18, 2008, at 5:13 PM, Mark S. Miller wrote:
> On Thu, Sep 18, 2008 at 4:52 PM, Brendan Eich <brendan at mozilla.org> wrote:
>> -0 and 0 are not the same "given floating point number". 1/-0 vs. 1/0 and
>> Math.atan2(-0,0) vs. 0,0 are but two examples.
> Yes, I understand their operational difference. Whether that difference
> means they are not the same number depends on how you define "number". I
> would have defined "representing the same number" by correspondence to the
> reals. YMMV.
> But the mathematical behavior of floating point numbers is not the same as
> that of the reals. Not just because of -0. See <
> Floating point numbers are a useful rough approximation of the reals for
> many practical calculations, but treating them as if they were in fact a
> subset of the reals is not mathematically sound.
Long long ago I actually had read that document carefully, and I had also
looked at I think the [Brown 1981] which it cites. (But the doc has no
bibliography. Anyone have a pointer?) My memory of the theory of floating
point is that the numbers are exact but the operations are approximate.
* A given finite floating point value exactly represents a given real
* The subset of real numbers which are exactly representable in a given
format are its "representable numbers".
* The standards require various well behaved properties like:
Let Tr = B2R(Xb) +r B2R(Yb) // Tr stands for True sum as a real number
If representable(Tr) then Tr ===r B2R(Xb +b Yb)
Else (greatest representable number <r Tr) <r B2R(Xb +b Yb) <r (smallest
representable number >r Tr)
Since we have many people on this list much more expert on this than I, if
the above summary is mistaken, I'm sure someone will correct.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Es-discuss