lz_log_b
The logarithm to the number's own base.
long lz_log_b( CLZNumber* leftOperand, CLZNumber* targetNumber = nullptr );
ln x ÷ ln b, where b is the operand's own base: log10 for a decimal number, log2 for a binary one. It is worked wider and rounded once, and a logarithm that is a fraction is decided exactly. The answer is in the operand's base, so log2 8 is written 11.
Examples
| Call | Answer |
|---|---|
lz_log_b( 1000 ) | 3.000000000000000000000000000000000000 |
lz_log_b( 2 ) | 0.301029995663981195213738894724493027 |
lz_log_b( 8 ) base 2 | 11.000000000000000000000000000000000000 base 2 |
lz_log_b( 0.5 ) base 16 | −0.400000000000000000000000000000000000 base 16 |
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.