On Wed, Nov 4, 2009 at 11:52 PM, Jean-Luc Menut <[email protected]> wrote: > Hello all, > > > > If if define 2 variables a and b by doing the following : > > on [5]: a > Out[5]: array([ 1.7]) > > In [6]: b=array([0.8])+array([0.9]) > > In [7]: b > Out[7]: array([ 1.7]) > > > if I test the equality of a and b, instead to obatin True, I have :
You should never test for strict equality with floating point numbers except for particular situations. You should instead test whether they are close in some sense (up to N decimal, for example). David _______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
