Javascript floating point number usable ranges -



Javascript floating point number usable ranges -

i got infinitely zooming grid work , tried out how much can zoom. worked fine until around 15,000,000,000,000x magnification got jerky , didn't move right anymore figured had nail limit of precision of whatever variable type using. tried zooming out , expected similar limit 5 minutes later, @ magnification of 0.00000-insert 100 zeros here-0014829095701452545 still doing great. if 1 1m in relation planck length within planck length within planck length. crazy!

so not problem question curiosity 1 - kind of types javascript utilize floats? , why capable of using much longer tiny numbers big numbers?

the problem precision loss is.

when have huge number, start losing precision around units, can cause huge problems.

with tiny number, precision loss @ low decimal places, you'd have precision loss due not having plenty digits store number anyway. there's no real problem here.

does create sense? it's difference between:

1234567890123457000 -- big precision loss (321) 0.00000001234567890123457 -- tiny precision loss (0.000000...0001)

javascript

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -