Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Behavior of np.sign for complex number (Trac #1250) #1848

@thouis

Description

@thouis

Original ticket http://projects.scipy.org/numpy/ticket/1250 on 2009-10-06 by @huard, assigned to @pv.

For complex arguments, np.sign returns the following:

> [10]: np.sign(1j)
 <[10]: (1+0j)

> [11]: np.sign(-1j)
 <[11]: (-1+0j)

> [12]: np.sign(1-1j)
 <[12]: (1+0j)

So the sign of the real part takes precedence on the sign of the complex part when there is a real part. I'm not sure if this qualifies as a bug, but it's not intuitive, nor documented.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions