On 5 Des, 16:37, Anton81 <gerenu...@googlemail.com> wrote: > I'd like to do calculations with floats and at some point equality of > two number will be checked. > What is the best way to make sure that equality of floats will be > detected, where I assume that mismatches beyond a certain point are > due to truncation errors?
isequal = lambda x,y : abs(x-y) < eps where eps is the truncation error. -- http://mail.python.org/mailman/listinfo/python-list