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

compute natural logarithm 

Function


SYNOPSIS

#include <math.h>

double log(double x)

float logf(float x)

double log2(double x)

float log2f(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 log2() and log2f() functions return the base 2 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(), log2f(), log10f(), and log1pf() functions are single-precision versions of log(), log2(), 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(), log2(), and log10() where x is < 0.0, and for log1p() where x is < 1.0 then:

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


CONFORMANCE

log(), log2(), log10(), log1p(): ANSI/ISO 9899:1999 'ISO C99'


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

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


SEE ALSO

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


PTC MKS Toolkit 10.4 Documentation Build 39.