Another solution
http://code.activestate.com/recipes/577124-approximately-equal/
--
Fabrice Silva
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
I've haven't found any clean way. So I'll use numpy.allclose in my doctests.
It will be harder to read, less interactive-session-like, but it might show the
reader how compare floats properly.
On Fri, Oct 15, 2010 at 2:05 PM, Fabrice Silva si...@lma.cnrs-mrs.fr wrote:
Maybe you should not rely
Hello all,
I use doctest for examples and tests in a program which relies heavily on numpy.
As floating point calculations differs slightly across computers
(32/64 bits), I have troubles
writing portable doctests.
The doctest documentation [1] advises to use numbers in the form
int/2**n. This