2 ms·
It's a signed integer. The overflow will make the number negative, not zero.
by gs17 4y ago
It's a signed integer. The overflow will make the number negative, not zero.
- SAI_Peregrinus 4y agoAnd because it's JS. Not every language defines signed integer overflow as wrapping.
- chipsa 4y agoMost languages assume twos complement signed numbers. So an uncaught overflow will be wrapped around JS specifically won’t necessarily wrap at this point, because adding one to the Max 32 but signed int maybe be a float.