log()
Calculates the natural logarithm
Synopsis
float log(float x);
Parameters
Parameter | Description |
---|---|
x | value greater than 0 |
Return value
In the event of an error, the function returns 0.0.
If the argument is lying outside of the value range ]0..], NaN (Not a Number) is returned.
Description
Returns the natural logarithm (base e) of x, for x > 0.
Example
main()
{
float f;
f = log(1);
// returns 0
f = log(100);
// returns 4.6051701859881
f = exp(log(10));
// returns 10
}
Assignment
mathematical function
Availability
CTRL