Logarithmic Functions

Prev Next

Function Names

ln, log

Description

ln(x) calculates logarithm on base e
log(x) calculates logarithm on base 10.

Call as: function

Restrictions

Indirect parameter passing is disabled

Parameter count

1

Parameters

No.TypeDescription
1
input
numeral Value

Value to use for logarithmic calculation

Return value

TypeDescription
numeral Result

Calculated logarithm value

Examples

      echo( log( 1000 ), " ", log( 0.001 ) );
      echo( ln(1000) / ln( 10 ), " ", ln( 0.001) / ln(10) );

Output

3 -3
3 -3
Try it yourself: Open LIB_Function_ln.b4p in B4P_Examples.zip. Decompress before use.

See also

Exponential Functions