News for hackers. Stuff that matters.
Re:JavaScript Is Weird by kerkeslager on Sunday August 13, 2023 @01:04PM (#37111796)
Yeah, this is a IEEE754 floating point issue.

I'm not sure why it seems there hasn't been any progress made on making floating point types less error-prone in the last few decades.

Re:JavaScript Is Weird by bazoom42 on Monday August 14, 2023 @06:21AM (#37119355)
Rounding errors are unavoidable when representing an infinite amout of numbers in a fixed number of bits. But in many cases a decimal type (like in C#) would have more intuitive behvior than binary floating point. A decimal type have been proposed for JavaScript but I dont know how far along it is.