Skip to content

Commit

Permalink
DOC: update documentation of sign for complex and nan inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
grlee77 committed Oct 9, 2015
1 parent 608f6e8 commit e2eabf4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions numpy/core/code_generators/ufunc_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2799,12 +2799,13 @@ def add_newdoc(place, name, doc):
"""
Returns an element-wise indication of the sign of a number.
The `sign` function returns ``-1 if x < 0, 0 if x==0, 1 if x > 0``.
The `sign` function returns ``-1 if x < 0, 0 if x==0, 1 if x > 0``. nan
is returned for nan inputs.
For complex inputs, the `sign` function returns:
``-1+0j if x.real < 0,
1+0j if x.real > 0,
sign(x.imag)+0j if x.real == 0.``
For complex inputs, the `sign` function returns
``sign(x.real) + 0j if x.real != 0 else sign(x.imag) + 0j``.
complex(nan, 0) is returned for complex nan inputs.
Parameters
----------
Expand Down

0 comments on commit e2eabf4

Please sign in to comment.