use decimal
Maciej Stachowiak
mjs at apple.com
Thu Sep 18 17:22:04 PDT 2008
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 <http://docs.sun.com/source/806-3568/ncg_goldberg.html
>
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.
> In any case, my question is, does there exist any similar
> operational difference between decimal floating point values that
> are considered to be in the same cohort? If not, then I back Sam's
> proposal without compareTotal().
I assumed not, but it would be nice to hear from an expert.
If there is an operational difference (in the sense you helpfully
expressed in more precise form) then I tend to think it undermines the
notion of cohort.
Regards,
Maciej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.mozilla.org/pipermail/es-discuss/attachments/20080918/cd50a898/attachment.html
More information about the Es-discuss
mailing list