Math Library Functions


log, logf


Syntax

#include <math.h>
double log(double x);
float  logf(float x);

Arguments

x

Return Value

The natural log of x

Description

Computes the natural log of x using the following formula:

log(x) = 2*((x-1)/(x+1)) + 2/3*((x-1)/(x+1))^3
	+ (2/(2k+1))((x-1)/(x+1))^(2k+1) (k=0,1,2....)
log(2^k * x) = k * log(2) + log(x)