DEV Community

Discussion on: True or False: Math.pow(2, 53) == Math.pow(2, 53) + 1 ?

Collapse
 
sahas023 profile image
sahas023

The MAX_SAFE_INTEGER in Javascript is 2^53 - 1, meaning that in this range integers are safe to be represented and compared. Any integer above this value will not be safe to be compared anymore, thus 2^53 == 2^53 + 1 evaluates to true, which is mathematically incorrect.