addaptic

Reference Logarithms

lz_log_n

The logarithm of the right number to the base of the left.

long lz_log_n( CLZNumber* leftOperand, CLZNumber* rightOperand, CLZNumber* targetNumber = nullptr );

ln x ÷ ln n, worked wider and rounded once. The base comes first: lz_log_n( 2, 8 ) is 3. The answer is in the base's base.

Examples

CallAnswer
lz_log_n( 2, 8 )3
lz_log_n( 10, 2 )0.301029995663981195213738894724493027
lz_log_n( 3, 0.5 )−0.630929753571457437099527114342760854

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_log_e The natural logarithm.
  • lz_log_b The logarithm to the number's own base.
  • lz_exp_n The left number raised to the power of the right.
  • lzc_log_n The principal logarithm of the right complex number to the base of the left.