0

I'm using jQuery 1.6.2, the follow picture is the strange problem I found in jQuery (screenshot from my chrome):

enter image description here

Please notice the highlight position. This is so strange, the jQuery function parseJSON change the "picture_id" field. Why?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
PinkyJie
  • 817
  • 3
  • 8
  • 28

2 Answers2

3

The number is too large to fit in a 32 bit integer, so it is stored in a floating point variable. The precision of floating point values is insufficient to store all significant digits in the value in your JSON object.

A good explanation of the floating-point precision "problem" can be found here:

http://floating-point-gui.de/basic/

Philippe Leybaert
  • 168,566
  • 31
  • 210
  • 223
0

Your number is just to big so it is rounded down to the highest possible number.

What is JavaScript's highest integer value that a Number can go to without losing precision?

Try to use it as string. You could use this BigInt library.

Community
  • 1
  • 1
PiTheNumber
  • 22,828
  • 17
  • 107
  • 180