[MATRIX-SIG] umath.logical_blah vs normal python functions.

Perry A. Stoll pas@xis.xerox.com
Tue, 18 Nov 1997 13:46:18 PST


On 18 Nov , David Ascher wrote:
>> is there any reason for this difference in behaviour? It's unexpected
>> (well, it was unexpected by me :) 
>> 
>> >>> umath.logical_and(4,5)
>> 1
>> >>> 4 and 5
>> 5
> 
> Try:
> 
>   >>> umath.boolean_and(4,5)
> 
> logical_and returns 0 or 1, boolean_and works like Python's 'and'
> construct.

Did you try it? I get the following:

>>> umath.boolean_and(4,5)
4
>>> 4 & 5
4

Why? I'll leave it for someone else to sort out...

-Perry




_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________