DoxigAlpha

log

Returns the natural logarithm of z.

Function parameters

Parameters

#
z:anytype

Returns the natural logarithm of z.

Functions

#
log
Returns the natural logarithm of z.

Source

Implementation

#
pub fn log(z: anytype) Complex(@TypeOf(z.re, z.im)) {
    const T = @TypeOf(z.re, z.im);
    const r = cmath.abs(z);
    const phi = cmath.arg(z);

    return Complex(T).init(@log(r), phi);
}