addaptic

Reference Exponentials

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

CallAnswerReturns
lz_exp_e( 1 )2.718281828459045235360287471352662498kNoError
lz_exp_e( 1 ) 60 places2.718281828459045235360287471352662497757247093699959574966968kNoError
lz_exp_e( −1 )0.367879441171442321595523770161460867kNoError
lz_exp_e( 0.5 )1.648721270700128146848650787814163572kNoError
lz_exp_e( 1E24 )infinitekTooLarge

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