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
Post a Comment