lz_raise_n
The left number raised to a whole power, the right.
long lz_raise_n( CLZNumber* leftOperand, CLZNumber* rightOperand, CLZNumber* targetNumber = nullptr );
By repeated squaring, so the cost follows the number of digits in the exponent. A negative power is one over the positive one. A fraction is refused, kFailed, flagged not-a-number; lz_power takes any exponent.
Examples
| Call | Answer | Returns |
|---|---|---|
lz_raise_n( 2, 100 ) | 1267650600228229401496703205376 | kNoError |
lz_raise_n( 1.5, −2 ) | 0.444444444444444444444444444444444444 | kNoError |
lz_raise_n( 2, 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
lz_powerThe left number raised to the power of the right.lz_raise_ee raised to a whole power.lzc_raise_nA complex number raised to a whole power.