lz_exp_e
e raised to the power of the number.
long lz_exp_e( CLZNumber* leftOperand, CLZNumber* targetNumber = nullptr );
Correctly rounded: a Taylor series against precomputed reciprocal factorials, and at wide widths binary splitting a chunk of the fraction at a time.
An answer too large to hold is refused before any work is done: e to the 1024 returns kTooLarge, flagged infinite. One that rounds to nought at the working precision is nought at once.
Examples
| Call | Answer | Returns |
|---|---|---|
lz_exp_e( 1 ) | 2.718281828459045235360287471352662498 | kNoError |
lz_exp_e( 1 ) 60 places | 2.718281828459045235360287471352662497757247093699959574966968 | kNoError |
lz_exp_e( −1 ) | 0.367879441171442321595523770161460867 | kNoError |
lz_exp_e( 0.5 ) | 1.648721270700128146848650787814163572 | kNoError |
lz_exp_e( 1E24 ) | infinite | kTooLarge |
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_raise_ee raised to a whole power.lz_exp_bThe number's own base raised to the power of the number.lz_log_eThe natural logarithm.lzc_exp_ee raised to a complex power.