I faced problem and I can't quite explain it. Actually I'm quite surprised. When I try to increment the number 9933272057275866 by 1, it automatically adds 2!!! Please see following code:
let test = 9933272057275866;
let test2 = test+1;
console.log('Before:', test);
console.log('After:', test2);
console.log('Sub:', test2-test);
And respective output:
Before: 9933272057275866
After: 9933272057275868
Sub: 2
How can this be possible?
Environment is Javascript. I found this problem when I submitted a challenge at Hackerrank, then I also tried to do the same in my own environment on node.js. Same result!
What is happening?