Reference Complex exponentials, logarithms, powers and roots
lzc_raise_n
A complex number raised to a whole power.
long lzc_raise_n( CLZComplex* leftOperand, CLZNumber* rightOperand, CLZComplex* targetNumber = nullptr );
zn for a whole n, which is a CLZNumber, each part correctly rounded. A fraction is refused, kFailed; lzc_power takes any exponent.
Examples
| Call | Answer | Returns |
|---|---|---|
lzc_raise_n( 2 + 1i, 3 ) | 2 + 11i | kNoError |
lzc_raise_n( 1 + 1i, −2 ) | 0 − 0.5i | kNoError |
lzc_raise_n( 1 + 1i, 0.5 ) | not a number | kFailed |
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_powerA complex number raised to a complex power, the principal value e^(w ln z).lz_raise_nThe left number raised to a whole power, the right.