3 ms·
Fair enough. I was trying to come up with something weird that JavaScript does with numbers and I guess I chose the wrong thing.
by justin_oaks 5y ago
Fair enough. I was trying to come up with something weird that JavaScript does with numbers and I guess I chose the wrong thing.
- pletnes 5y agoJavascript is truly weird to me (I’ve programmed mostly in python and Fortran). From what I understood though, js uses IEEE 754 floating point for everything, simply because it works the same on pretty much any hardware platform. Arm, intel, power, whatever. Int/uint/… not so much. The numbers are therefore 100% sane. The insanity stems from converting «0.0» to float then guessing at how to format it (maybe «int» is what he meant?). Etc.