[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    exp(3M) manual page Table of Contents

Name

exp, expm1, log, log1p, log10, pow - exponential, logarithm, power

Synopsis

cc [ flag ... ] file ... -lm [ library ... ]

#include <math.h>

double exp(double x);

double expm1(double x);

double log(double x);

double log1p(double x);

double log10(double x);

double pow(double x, double y);

MT-Level

MT-Safe

Description

exp(x) computes the exponential function e**x.

expm1(x) computes (e**x)-1 accurately even for tiny x.

log(x) computes the natural logarithm of x.

log1p(x) computes log(1+x) accurately even for tiny x.

log10(x) computes the base-10 logarithm of x.

pow(x, y) computes x raised to the power y.

Return Values

For exceptional cases, matherr(3M) tabulates the values to be returned as dictated by various Standards.

See Also

matherr(3M)

Diagnostics

In IEEE754 mode (i.e. the -xlibmieee cc compilation option), log(±0) returns -if and raises the division by zero exception; if x<0, log(x) returns a NaN and raises the invalid operation exception; if x == +if or a quiet NaN, log(x) returns x and raises no exception; if x is a signaling NaN, log(x) returns a quiet NaN and raises the invalid operation exception; log(1) returns 0 and raises no exception; for all other positive x, log(x) returns a normalized number and raises the inexact exception.


Table of Contents