Converting a string to a number results in a different number
When I try to convert the bigint passed from php to an integer in nodejs, the result is always different, I couldn't figure out what was wrong with it.
> var a = parseInt('135601920000000040', 10); undefined > a 135601920000000030 > var a = parseFloat('135601920000000040'); undefined > a 135601920000000030 > var n = Number('135601920000000040'); undefined > n 135601920000000030
Not only node.js, this also happens with the js interpreter in Firefox
source to share