The problem is that numbers in Javascript are double-precision floats, which cannot represent 154456875042019001 accurately. Double-precision floats have 15-17 digits of precision and you have 18 digits. When converted to a float and back again some precision is lost.
For example, in Perl:
$a=154456875042019001.0;
printf "%20d",$a;
outputs
154456875042019008
Further details:
The hexadecimal representation of 154456875042019001
10 is 0x0224bdb5a1ff16b9
, which contains 58 significant bits (in binary it starts 0000 0010 0010 0100 ...
, so 64 minus 6 leading zero bits). Double-precision float has 52 bits of precision, so some bits are lost when converting the 64-bit long
to the double
.