[SciPy-user] "Approximately equal to" operator?

Robert Kern robert.kern at gmail.com
Thu Jun 8 01:22:22 CDT 2006

Martin Spacek wrote:
> I've noticed 
> there's a numpy function allclose(), but this doesn't return a boolean 
> array, just a single True if all the elements are equal.

Well, if you take a look at the source of allclose, the key part is this:

  less(absolute(x-y), atol + rtol * absolute(y))

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

More information about the SciPy-user mailing list