Anton81 <[EMAIL PROTECTED]> wrote: > Hi! > > When I do simple calculation with float values, they are rarely exactly > equal even if they should be. What is the threshold and how can I change > it?
Python's builtin floats compare for exact bit-by-bit equality -- no "threshold". You may want to look at the allclose function in the Numeric extension package, at least for its specs (it consider both absolute and relative difference). Extension module gmpy might also help, since its mpf floating numbers implement a fast reldiff (relative difference) method. Alex -- http://mail.python.org/mailman/listinfo/python-list