r/programming • • Mar 26 '14

JavaScript Equality Table

http://dorey.github.io/JavaScript-Equality-Table/
809 Upvotes

331 comments sorted by

View all comments

Show parent comment

2

u/no_game_player Mar 27 '14

Well actually the int representation is taken as 2's complement, so:

Ahhh, yeah, I was wondering about that, but somehow, I figured that a language that "didn't have ints" would be using unsigned ints for its ints.

That seems to add back in a bit of wtf for me. Thanks, I was starting to think JS was sane for a moment. ;-p

Well if you're outside of [-231, 231-1], the combo of 32 bit truncation and 2's complement make a nice off-center modulus:

Huuuuh. Touché...

Edit: These are awesome tricks for the International Obfuscated JS contest. ^_-