Reference Complex exponentials, logarithms, powers and roots
lzc_log_n
The principal logarithm of the right complex number to the base of the left.
long lzc_log_n( CLZComplex* leftOperand, CLZComplex* rightOperand, CLZComplex* targetNumber = nullptr );
ln z ÷ ln n, the principal value, with the base n first, as lz_log_n takes them; both may be complex. Each part correctly rounded and exact where the mathematics is: the logarithm of −1 to the base i is exactly 2. The answer is in the base's base.
Base one is a division by nought, kDivideByZero. A value or a base of nought is refused, kUndefinedResult, the point at infinity.
Examples
| Call | Answer | Returns |
|---|---|---|
lzc_log_n( 0 + 1i, −1 + 0i ) | 2 + 0i | kNoError |
lzc_log_n( 2 + 0i, 0 + 8i ) | 3 + 2.266180070913596904813841472858333405i | kNoError |
lzc_log_n( 1 + 0i, 2 + 0i ) | the point at infinity | kDivideByZero |
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.