Compute the natural logarithms.
Compatibility:This function is compatible with the following targets:
|
|
#include <math.h>
double log(double x);
float logf(float);
long double logl(long double);Parameters:
Parameters for this function are:
log() returns logex. If x < 0 the log() may assign EDOM to errno See "Floating point error testing.," for information on newer error testing procedures.
#include <math.h>
#include <stdio.h>
int main(void)
{
double x = 100.0;
printf("The natural logarithm of %f is %f\n",x, log(x));
printf("The base 10 logarithm of %f is %f\n",x, log10(x));
return 0;
}
Output:
The natural logarithm of 100.000000 is 4.605170
The base 10 logarithm of 100.000000 is 2.000000
[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.
Last updated: August 16, 2000