CONTENTS | INDEX | PREV | NEXT
log
flog
NAME
log - return the log of the double quantity, base e
flog - return the log of the float quantity, base e
SYNOPSIS
#include <math.h>
double a = log(b);
double b;
float c = flog(d);
float d;
FUNCTION
Returns the log of the floating point quantity, base e.
EXAMPLE
/*
* compile with the math library -lm
*/
#include <math.h>
#include <stdio.h>
main()
{
{
double a = log(0.25);
printf("log 0.25 = %lfn", a); /* -1.3863 */
}
{ /* less accuracy */
float a = flog(0.25);
printf("log 0.25 = %lfn", (double)a);
}
return(0);
}
INPUTS
double b; double floating point value
float d; float floating point value
RESULTS
double a; result double floating point value
float c; result float floating point value