[Numpy-discussion] sign, signbit and nans once again.

Robert Kern robert.kern@gmail....
Mon Mar 9 22:54:09 CDT 2009


On Mon, Mar 9, 2009 at 22:31, Charles R Harris
<charlesr.harris@gmail.com> wrote:
> I want to get this settled for the 1.3 release. My thoughts are:
>
> signbit returns the signbit whether or not the number is a nan.
> sign returns nan for nans.
>
> Copysign is currently unimplemented. I'm thinking of adding it, but making
> it return nans when copying the sign of a nan. This isn't how it is in BSD,
> but the behavior in this case is unspecified by the standard.

math.copysign() just uses the available copysign() function from libm.
I would prefer that we do the same.

-- 
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