approximate

How to perform approximate structural pattern matching for floats and complex

How to perform approximate structural pattern matching for floats and complex Question: I’ve read about and understand floating point round-off issues such as: >>> sum([0.1] * 10) == 1.0 False >>> 1.1 + 2.2 == 3.3 False >>> sin(radians(45)) == sqrt(2) / 2 False I also know how to work around these issues with math.isclose() …

Total answers: 2