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
| Call | Answer | Returns |
|---|---|---|
lzc_log_e( −1 + 0i ) | 0 + 3.141592653589793238462643383279502884i | kNoError |
lzc_log_e( 0 + 2i ) | 0.693147180559945309417232121458176568 + 1.570796326794896619231321691639751442i | kNoError |
lzc_log_e( 1 + 1i ) | 0.346573590279972654708616060729088284 + 0.785398163397448309615660845819875721i | kNoError |
lzc_log_e( 0 + 0i ) | the point at infinity | kUndefinedResult |
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.