[Matrix-SIG] possible bug in NumPy

Oliver Gathmann gathmann@scar.utoronto.ca
Tue, 5 May 1998 10:09:15 -0400 (EDT)


Hi all,

I think I found what looks like a bug in NumPy (I am not up to date with
the very latest release, but I don't remember this coming up here before):

Python 1.5 (#3, Feb 12 1998, 12:14:31)  [GCC 2.7.2.3] on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> from Numeric import *
>>> a = array([[1,1],[2,2]])
>>> b = array([[1.1,1.1],[2.1,2.1]])
>>> c = array([[0.1,0.1],[0.1,0.1]])
>>> abs(a-b)
array([[0.1,0.1],
       [0.1,0.1]])
>>> less_equal(abs(a-b),c)
array([[0, 0],
       [0, 0]])
>>> less_equal(c,abs(a-b))
array([[1, 1],
       [1, 1]])

Shouldn't that be 'all true' in both cases since abs(a-b) and c are the
same thing?

Oliver

Oliver Gathmann (gathmann@scar.utoronto.ca)
Surface and Groundwater Ecology Research Group      
University of Toronto
phone: (416) - 287 7420 ; fax: (416) - 287 7423