addaptic

Reference Logarithms

lz_log_e

The natural logarithm.

long lz_log_e( CLZNumber* leftOperand, CLZNumber* targetNumber = nullptr );

Correctly rounded: a series after argument reduction, and at wide widths Newton on the exponential, or the arithmetic-geometric mean.

ln 0 has no value: kUndefinedResult, flagged infinite. The logarithm of a negative number is refused, kFailed, flagged not-a-number; lzc_log_e gives the complex one.

Examples

CallAnswerReturns
lz_log_e( 2 )0.693147180559945309417232121458176568kNoError
lz_log_e( 10 ) 50 places2.30258509299404568401799145468436420760110148862877kNoError
lz_log_e( 0.5 )−0.693147180559945309417232121458176568kNoError
lz_log_e( 0 )infinitekUndefinedResult
lz_log_e( −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_exp_e e raised to the power of the number.
  • lz_log_b The logarithm to the number's own base.
  • lz_log_n The logarithm of the right number to the base of the left.
  • lzc_log_e The principal natural logarithm of a complex number.