log(), logf(), log10(), log10f(), log1p(), log1pf()

compute natural logarithm 

Function


SYNOPSIS

#include <math.h>

double log(double x)

float logf(float x)

double log10(double x)

float log10f(float x)

double log1p(double x)

float log1pf(float x)


DESCRIPTION

The log() function computes the value of the natural logarithm of argument x.

The log10() function computes the value of the logarithm of argument x to base 10.

The log1p() function computes the value of log(1+x) accurately even for tiny argument x.

To check for error situations, set errno to 0 before calling log(). If errno is non-zero on return, or the return value is NaN, an error has occurred. The logf(), log10f(), and log1pf() functions are single-precision versions of log(), log10() and log1p() respectively.


PARAMETERS

x 

Is the number whose logarithm is to be computed.


RETURN VALUES

If successful, these functions return the requested results.

If x is NaN, NaN is returned.

For log() and log10() where x is < 0.0, and for log1p() where x is < 1.0 then:

For log() and log10() where x is 0.0, and for log1p() where x is 1.0, then:


CONFORMANCE

log(), log10(), log1p(): UNIX 98.

logf(), log10f(), log1pf(): MKS Toolkit UNIX APIs extension.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
exp(), logb(), math(), pow(), sqrt()


MKS Toolkit 9.2 Documentation Build 16.