Re:What should every programmer know about programming?
by Erwin on Wednesday September 15, 2010 @07:04PM
(#1696184)
The result of this is a 64-bit double (there are no other numeric data types in JS and this is the data type regardless of the underlying CPU architecture). That has just under 16 digits of precision so the above code will not lose much by multiplying by 10^16 and rounding.
Why would you think this this calculation would get clamped to the range of a signed 32-bit integer?
Why would you think this this calculation would get clamped to the range of a signed 32-bit integer?