News for hackers. Stuff that matters.
Re:What Every Computer Scientist Should Know About Floating-... by kstenerud on Monday June 29, 2020 @11:37AM (#23678544)
Unfortunately, JSON doesn't have a mechanism for 100% accuracy in transmitting binary floating point numbers. Everything gets marshaled to decimal float, and then unmarshaled to binary float - even in machine-to-machine communication. That's simply a limitation of the format.

It's part of the reason I developed Concise Encoding: https://github.com/kstenerud/concise-encoding/#example which allows hex float notation when you need to be exact.

Re:What Every Computer Scientist Should Know About Floating-... by enriquto on Monday June 29, 2020 @12:05PM (#23678833)
> Unfortunately, JSON doesn't have a mechanism for 100% accuracy in transmitting binary floating point numbers.

If it was just inaccurate! It cannot even deal with straightforward floats like inf, nan, or minus zero!