Re:How does your programming language handle “minus zero” (-...
by kevin_thibedeau on Friday March 05, 2021 @11:58AM
(#26359062)
Don't blame the protocol, blame the language. Nothing prevents the use of fixed point for such numbers. It's just the Java ecosystem and the weakness of languages that use pervasive exceptions to the point that nobody can keep track of them all that is the cause of such issues.
[ Parent
| on HN ]
Re:How does your programming language handle “minus zero” (-...
by toast0 on Friday March 05, 2021 @12:20PM
(#26359298)
> Don't blame the protocol, blame the language. Nothing prevents the use of fixed point for such numbers.
I absolutely blame the protocol. Fixed point isn't widely available and used, but integers are. Someone below says protocol spec goes to three digits past the decimal. Using a constrained integer would have allowed the same range of values, but without the complexity of decimal numbers; that's a protocol mistake.
In addition to the ease of using floating point numbers to incorrectly represent decimals, there's also fun with formatting, comma vs period, number of digits to report, etc.