[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

log1p, log1pf, or log1pl Subroutine

Purpose

Computes a natural logarithm.

Syntax

#include <math.h>

float log1pf (x)
float x;

long double log1pl (x)
long double x;

double log1p (x)
double x;

Description

The log1pf, log1pl, and log1p subroutines compute loge (1.0 + x).

An application wishing to check for error situations should set the errno global variable to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these subroutines. Upon return, if errno is nonzero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is nonzero, an error has occurred.

Parameters

x Specifies the value to be computed.

Return Values

Upon successful completion, the log1pf, log1pl, and log1p subroutines return the natural logarithm of 1.0 + x.

If x is -1, a pole error occurs and the log1pf, log1pl, and log1p subroutines return -HUGE_VALF, -HUGE_VALL, and -HUGE_VAL, respectively.

For finite values of x that are less than -1, or if x is -Inf, a domain error occurs, and a NaN is returned.

If x is NaN, a NaN is returned.

If x is ±0, or +Inf, x is returned.

If x is subnormal, a range error may occur and x should be returned.

Related Information

feclearexcept Subroutine and fetestexcept Subroutine.

math.h in AIX 5L Version 5.2 Files Reference.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]