On Sun, Aug 24, 2008 at 11:15 PM, Mark S. Miller <[EMAIL PROTECTED]> wrote:
> On Sun, Aug 24, 2008 at 8:09 PM, Sam Ruby <[EMAIL PROTECTED]> wrote:
>> All things considered, I would argue for false.
>
> I'm curious. If 1.0m == 1.00m were false, what about 1.0m < 1.00m and
> 1.0m > 1.00m?

1.0m == 1.00m should be true.

But to answer your question, IEEE 754 does define a "total" ordering.
One can even test is using the implementation I posted a few weeks
back.

js> Decimal.compareTotal(1.0m, 1.00m)
1
js> Decimal.compareTotal(1.00m, 1.0m)
-1

"This function compares two numbers using the IEEE 754 total ordering.
If the lhs is less than the rhs in the total order then the number
will be set to the value -1. If they are equal, then number is set to
0. If the lhs is greater than the rhs then the number will be set to
the value 1.

The total order differs from the numerical comparison in that: –NaN <
–sNaN < –Infinity < –finites < –0 < +0 < +finites < +Infinity < +sNaN
< +NaN. Also, 1.000 < 1.0 (etc.) and NaNs are ordered by payload."

> --
>    Cheers,
>    --MarkM

- Sam Ruby
_______________________________________________
Es-discuss mailing list
Es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to