1

I'm trying to get a number from a string but it's returning the wrong value

Number("580682945690490185")
580682945690490200

parseInt("580682945690490185")
580682945690490200
4

1 Answer 1

2

That number is bigger than the maximum safe number as in IEEE 754 you can only safely represent numbers between -(2^53 - 1) and 2^53 - 1.

You should try with BigInt which has no limit

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.