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
  • 704,970
  • 168
  • 1,303
  • 1,425
PinkyJie
  • 787
  • 3
  • 7
  • 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
  • 162,851
  • 30
  • 206
  • 220
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
  • 21,608
  • 17
  • 100
  • 173