Built-in functions: math_log()

The function math_log() calculates natural logarithm (base e=2.718281...).

Declaration

float math_log( float aValue )

Parameters

aValue

The value to calculate the natural logarithm.

Discussion

The function math_log() calculates the natural logarithm (base e=2.718281...) of the given value aValue. For example:

var float x1 = math_log( 1.0 ); // x1 = 0.0 var float x2 = math_log( 10.0 ); // x2 = 2.302585124

Passing a negative value causes the function to return a Not a Number (NaN) value. Passing 0 (zero) causes the function to return Negative Infinity value. See also float_nan() and float_infn().