javascript - parseInt changes the integer -



javascript - parseInt changes the integer -

i trying pull number (72157648141531978), starts @ 21st character, out of title of page so:

parseint(document.title.substring(21), 10);

this returns string integer of 72157648141531980. can't seem figure out why changing lastly 2 numbers. help appreciated.

according what javascript's max int? what's highest integer value number can go without losing precision? max value of integer 9007199254740992.

i tried calculation on http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_parseint , can confirm problem.

it looks issue parsing beyond max value , rounding lastly 2 figures.

javascript integer substring parseint

Comments

Popular posts from this blog

php - How to pass multiple values from url -

database - php search bar when I press submit with nothing in the search bar it shows all the data -

ios - How to load .png images from Documents folder of an app -