Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

matherr(3M)

EXP(3M)  —  MATHEMATICAL LIBRARY

NAME

exp, expm1, exp2, exp10, log, log1p, log2, log10, pow − exponential, logarithm, power

SYNOPSIS

#include <math.h>

double exp(x)
double x;

double expm1(x)
double x;

double exp2(x)
double x;

double exp10(x)
double x;

double log(x)
double x;

double log1p(x)
double x;

double log2(x)
double x;

double log10(x)
double x;

double pow(x, y)
double x, y;

DESCRIPTION

exp() returns the exponential function e∗∗x.

expm1() returns e∗∗x−1 accurately even for tiny x.

exp2() and exp10() return 2∗∗x and 10∗∗x respectively. 

log() returns the natural logarithm of x.

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

log2() and log10() return the logarithm to base 2 and 10 respectively. 

pow() returns x∗∗y. pow(x,0.0) is 1 for all x, in conformance with 4.3BSD, as discussed in the Floating Point Programmers Guide. 

SEE ALSO

matherr(3M)

DIAGNOSTICS

All these functions handle exceptional arguments in the spirit of ANSI/IEEE Std 754-1985.  Thus for x == ±0, log(x) is −∞ with a division by zero exception; for x < 0, including −∞, log(x) is a quiet NaN with an invalid operation exception; for x == +∞ or a quiet NaN, log(x) is x without exception; for x a signaling NaN, log(x) is a quiet NaN with an invalid operation exception; for x == 1, log(x) is 0 without exception; for any other positive x, log(x) is a normalized number with an inexact exception. 

In addition, exp,exp2,exp10, log,log2,log10, and pow() may also set errno and call matherr(3M). 

Sun Release 4.0  —  Last change: 21 January 1988

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026