I am trying to parse a hex string to a decimal number in javascript, but i meet something so weird.
The hex string is '27a4b0795a7d749c'
, I know the decimal number is 2856602098915439772
checked by python and windows's calc. But the js's parseInt doesn't return right answer.
Here's the test code:
var hex = '27a4b0795a7d749c';
console.log(hex);
var num = parseInt(hex, 16);
console.log(num);
var hex2 = num.toString(16);
console.log(hex2);
the console display (I am using Chrome 30.0.1599.101 m on Windows 64bits):
I test it in IE9, and it get 2856602098915439600
as well. But how does this happened?