Hacker News new | past | comments | ask | show | jobs | submit login

What would entail to declare a "true integer"?

Correctness? The |0 after each operation makes it correct. All bitwise operations in JS operate on signed 32 bit integers.

Speed? All JS JITs have optimizations for integers, and it's the reason asm.js uses that trick, not the other way around.

Precision? If you don't use bitwise operations, you have up to 53 bits of perfect integer precision, plus bit sign. Guaranteed by the standard.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: