[SciPy-user] A good way to test an array is zero to within numerical accuracy?

Russell E. Owen rowen at u.washington.edu
Fri Jan 23 18:29:07 EST 2009


I recommend numpy.allclose

-- Russell

In article 
<bfb379e10901231403t62fed6b1pfc35d4daea4d911a at mail.gmail.com>,
 iCy-fLaME <icy.flame.gm at gmail.com> wrote:

> What would be a good way to test an array is zero everywhere to within
> numerical accuracy? Such that, plus minus 0x1 for the float's
> significand is as good as 0x0.
> 
> The test must be able to cope with both single and double floats,
> because they are given at run time.
> 
> Thanks in advance.
> 
> 
> 
> iCy




More information about the SciPy-User mailing list