[Numpy-discussion] np.bitwise_and.identity

Robert Kern robert.kern at gmail.com
Wed Sep 2 12:20:36 EDT 2009


On Wed, Sep 2, 2009 at 11:11, Citi, Luca<lciti at essex.ac.uk> wrote:
> Hello,
> I know I am splitting the hair, but should not
> np.bitwise_and.identity be -1 instead of 1?
> I mean, something with all the bits set?

Probably. However, the .identity parts of ufuncs were designed mostly
to support multiply and add, so .identity is restricted to 0, 1, or
nothing currently. It will take some effort to change that. In the C
code, the sentinel value for "no identity" is -1, alas.

-- 
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 NumPy-Discussion mailing list