M
M
mirrorcoder2016-07-24 01:31:15
Google Chrome
mirrorcoder, 2016-07-24 01:31:15

Problem with large odd numbers in Google Chrome. What could be the problem?

Hello!
Found this problem. I make an AJAX request to the server and for example a response comes

{'pk': 17849640217091236}

But I sent another response from the server
{'pk': 17849640217091237}

Then I typed in the browser debugger just the number 17849640217091237 and got the following result
_WLUWdN4x2E.jpg
. What could be the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2016-07-24
@mirrorcoder

If it's just an identifier, pass it as a string.
This is a precision issue - double precision has a limit too.

D
dom1n1k, 2016-07-24
@dom1n1k

console.log(Number.MAX_SAFE_INTEGER)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question