Created
January 17, 2013 15:15
-
-
Save madrobby/4556637 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ irb | |
irb(main):001:0> 10000000000000000 == 10000000000000001 | |
=> false | |
$ node | |
> 10000000000000000 == 10000000000000001 | |
true |
Is this because of the actual size of the number and how it is stored? I'm thinking similar to the 0.2 + 0.1 == 0.3
bug.
JS stores numbers as floating point values only, no true integers, and only 53 bits precision for the left side of the decimal (I think).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is clear that JS+Node scale better, they can do more comparisons with only one object!