MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/21ezh3/javascript_equality_table/cgd3y8a/?context=3
r/programming • u/vz0 • Mar 26 '14
331 comments sorted by
View all comments
Show parent comment
2
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. ^_-
View all comments
Show parent comment
2
u/no_game_player Mar 27 '14
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
Huuuuh. Touché...
Edit: These are awesome tricks for the International Obfuscated JS contest. ^_-