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

Technical Reference: Base Operating System and Extensions, Volume 1

log10, log10f, or log10l Subroutine

Purpose

Computes the Base 10 logarithm.

Syntax

#include <math.h>

float log10f (x)
float x;

long double log10l (x)
long double x;

double log10 (x)
double x;

Description

The log10f, log10l, and log10 subroutines compute the base 10 logarithm of the x parameter, log10 (x).

An application wishing to check for error situations should set errno 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 log10, log10f, and log10l, subroutines return the base 10 logarithm of x.

If x is ±0, a pole error occurs and log10, log10f, and log10l subroutines return -HUGE_VAL, -HUGE_VALF and -HUGE_VALL, respectively.

For finite values of x that are less than 0, 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 1, +0 is returned.

If x is +Inf, +Inf is returned.

Error Codes

When using the libm.a library:

log10 If the x parameter is less than 0, the log10 subroutine returns a NaNQ value and sets errno to EDOM. If x= 0, the log10 subroutine returns a -HUGE_VAL value but does not modify errno.

When using libmsaa.a(-lmsaa):

log10 If the x parameter is not positive, the log10 subroutine returns a -HUGE_VAL value and sets errno to EDOM. A message indicating DOMAIN error (or SING error when x = 0) is output to standard error.
log10 If x < 0, log10l returns the value NaNQ and sets errno to EDOM. If x equals 0, log10l returns the value -HUGE_VAL but does not modify errno.

Related Information

feclearexcept Subroutine, fetestexcept Subroutine, class, _class, finite, isnan, or unordered Subroutines, and madd, msub, mult, mdiv, pow, gcd, invert, rpow, msqrt, mcmp, move, min, omin, fmin, m_in, mout, omout, fmout, m_out, sdiv, or itom Subroutine.

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

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