News for hackers. Stuff that matters.
Re:How to compare floats in Python by cuteboy19 on Wednesday March 30, 2022 @01:42PM (#30858402)
> Decimal has all of the same rounding properties that binary floating point has

This is not true.

> Unlike hardware based binary floating point, the decimal module has a user alterable precision (defaulting to 28 places) which can be as large as needed for a given problem

> Both binary and decimal floating point are implemented in terms of published standards. While the built-in float type exposes only a modest portion of its capabilities, the decimal module exposes all required parts of the standard. When needed, the programmer has full control over rounding and signal handling. This includes an option to enforce exact arithmetic by using exceptions to block any inexact operations.

https://docs.python.org/3/library/decimal.html

Re:How to compare floats in Python by noobermin on Wednesday March 30, 2022 @03:39PM (#30859880)
I think they mean in the abstract. With a fixed precision, you have round-off error as long as you only have a fixed number of digits, and thus have all the attendant issues in computations with them.