public static function log($z) {
        if (!($z instanceof Complex)) $z = static::parse($z);

        $r = $z->abs();
        $theta = $z->arg();

        if ($r == 0) return new Complex(NAN, NAN);

        return new Complex(log($r), $theta);
    }
public static function log($z) {
        if (!($z instanceof Complex)) $z = static::parse($z);

        $r = $z->abs();
        $theta = $z->arg();

        if ($r == 0) return new Complex(NAN, NAN);

        return new Complex(log($r), $theta);
    }
public static function log ( $ z ) { if ( ! ( $ z instanceof Complex ) ) $ z = static :: parse ( $ z ) ; $ r = $ z -> abs ( ) ; $ theta = $ z -> arg ( ) ; if ( $ r == 0 ) return new Complex ( NAN , NAN ) ; return new Complex ( log ( $ r ) , $ theta ) ; }
complex logarithm function

Complex::log($z) computes and returns the principal branch of log($z)


@param mixed $z (Complex, or parsable to Complex)
@retval Complex
complex logarithm function