The logf
function calculates the natural logarithm ( or ) of the argument passed, when the argument is of the float
type.
#include<math.h>
float logf( float number );
str
- float
value.
If no errors occur, is returned.
If a negative number is passed as an argument, an error occurs.
#include <math.h>#include <stdio.h>int main(){float result;float x = 10.2;result = logf(x);printf("The natural log of %f is %f\n", x, result);return 0;}
Free Resources