Revisiting Decimal

Brendan Eich brendan at mozilla.com
Fri Jan 9 14:59:16 PST 2009


On Jan 9, 2009, at 2:54 PM, Kris Zyp wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> What is the current state of the result of typeof on decimals, was
> there consensus on this?

Did you follow Sam's link?

http://intertwingly.net/stories/2008/09/20/estest.html


> I hope we will be using typeof 1.1m ->
> "number". For a little bit of emperical evidence, I went through
> Dojo's codebase and their are numerous places that we would probably
> want to alter our code to include additional checks for "decimal" if
> typeof 1.1m -> "decimal", whereas if "number" we would probably leave
> virtually everything intact in regards to number handling with
> consideration for decimals.
> Thanks,

The counter-argument is strong:

typeof x == typeof y => (x == y <=> x === y)

but 1.1 != 1.1m for fundamental reasons.

/be



More information about the Es-discuss mailing list