addaptic

Reference Complex exponentials, logarithms, powers and roots

lzc_log_e

The principal natural logarithm of a complex number.

long lzc_log_e( CLZComplex* leftOperand, CLZComplex* targetNumber = nullptr );

ln |z| + i arg z, the principal value, each part correctly rounded. The imaginary part is in (−π, π], in radians whatever the thread's unit.

The cut is the negative real axis, taken from the +0 side, as std::complex takes it: ln(−1) is exactly πi. On the positive real axis it answers as lz_log_e does, with an exact nought beside it. ln 0 is refused, kUndefinedResult, the point at infinity.

Examples

CallAnswerReturns
lzc_log_e( −1 + 0i )0 + 3.141592653589793238462643383279502884ikNoError
lzc_log_e( 0 + 2i )0.693147180559945309417232121458176568 + 1.570796326794896619231321691639751442ikNoError
lzc_log_e( 1 + 1i )0.346573590279972654708616060729088284 + 0.785398163397448309615660845819875721ikNoError
lzc_log_e( 0 + 0i )the point at infinitykUndefinedResult

Each answer is what Addaptic printed for the call, at 36 places unless a setting is shown.

Returns

kNoError (0) when the answer is written. Otherwise an error code, with the answer flagged infinite or not-a-number; see Errors and flags.

See also

  • lzc_exp_e e raised to a complex power.
  • lzc_log_b The principal logarithm to the base the number is written in.
  • lzc_log_n The principal logarithm of the right complex number to the base of the left.
  • lz_log_e The natural logarithm.