log(x)
Return the "principal value" (for a description of this, see numpy.log
) of $log_e(x)$
. For real :None:None:`x > 0`
, this is a real number ( log(0)
returns -inf
and log(np.inf)
returns inf
). Otherwise, the complex principle value is returned.
For a log() that returns NAN
when real :None:None:`x < 0`
, use numpy.log
(note, however, that otherwise numpy.log
and this log
are identical, i.e., both return -inf
for :None:None:`x = 0`
, inf
for :None:None:`x = inf`
, and, notably, the complex principle value if x.imag != 0
).
The value(s) whose log is (are) required.
The log of the x
value(s). If x
was a scalar, so is :None:None:`out`
, otherwise an array is returned.
Compute the natural logarithm of x
.
>>> np.emath.log(np.exp(1)) 1.0
Negative arguments are handled "correctly" (recall that exp(log(x)) == x
does not hold for real x < 0
):
>>> np.emath.log(-np.exp(1)) == (1 + np.pi * 1j) TrueSee :
The following pages refer to to this document either explicitly or contain code examples using this.
numpy.lib.scimath.log
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them