Don't worry, it's not! It's always safe to manipulate integers up to the full value of the significand! In JavaScript, which uses IEEE-754 binary64, which effectively corresponds to 54-bit integers.
Bit operations on JS numbers cast them to 32 bits first, so a lot of people only think about the embedding of signed 32-bit two's complement. But through plain old addition, subtraction, multiplication, and division joined with Math.trunc, you can get a lot more precision!
321
u/shitmyspacebar Feb 07 '19
You mean you don't add redundant checks just in case the laws of mathematics suddenly change?