addaptic

Reference Powers and roots

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

CallAnswerReturns
lz_raise_n( 2, 100 )1267650600228229401496703205376kNoError
lz_raise_n( 1.5, −2 )0.444444444444444444444444444444444444kNoError
lz_raise_n( 2, 0.5 )not a numberkFailed

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_power The left number raised to the power of the right.
  • lz_raise_e e raised to a whole power.
  • lzc_raise_n A complex number raised to a whole power.