Type this in the console of your browser:
9999999999999999==10000000000000000
It says they are equal, why?
Type this in the console of your browser:
9999999999999999==10000000000000000
It says they are equal, why?
JavaScript only supports 53 bit integers
All numbers in JavaScript are floating point which means that integers are always represented as
sign × mantissa × 2exponent
The mantissa has 53 bits. You can use the exponent to get higher integers, but then they won’t be contiguous, any more. For example, you generally need to multiply the mantissa by two (exponent 1) in order to reach the 54th bit. However, if you multiply by two, you will only be able to represent every second integer: