Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ log(3m) — Ultrix WS 2.0 VAX

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

hypot(3m)

intro(3m)

sinh(3m)

exp(3m)

NAME

exp, expm1, log, log10, log1p, pow, sqrt − exponential, logarithm, power, square root

SYNTAX

#include <math.h>

double exp(x)
double x;

double expm1(x)
double x;

double log(x)
double x;

double log10(x)
double x;

double log1p(x)
double x;

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

double sqrt(x)
double x;

DESCRIPTION

The exp function returns the exponential function of x. 

The expm1 function returns exp(x)-1 accurately even for tiny x.

The log function returns the natural logarithm of x; log10 returns the base 10 logarithm.

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

The pow function returns x raised to the y power. 

The sqrt function returns the square root of x. 

ENVIRONMENT

When your program is compiled using the System V environment, exp returns HUGE when the correct value would overflow, and sets errno to ERANGE. 

The log and log10 functions return HUGE and set errno to EDOM when x is nonpositive.  An error message is printed on the standard error output. 

The pow function returns 0 and sets errno to EDOM when x is non-positive and y is not an integer, or when x and y are both zero.  In these cases, a message indicating DOMAIN error is printed on the standard error output.  When the correct value for pow would overflow, pow returns HUGE and sets errno to ERANGE. 

The sqrt function returns 0 and sets errno to EDOM when x is negative.  A message indicating DOMAIN error is printed on the standard error output. 

These error-handling procedures may be changed with the function matherr(.).

RETURN VALUE

The exp, expm1, and pow functions return a huge value when the correct value would overflow; errno is set to ERANGE.  The function pow returns 0 and sets errno to EDOM when the second argument is negative and non-integral and when both arguments are 0. 

The log function returns 0 when x is zero or negative; errno is set to EDOM.  The log1p function returns 0 when x is less than or equal to −1; errno is set to EDOM. 

The sqrt function returns 0 when x is negative; errno is set to EDOM. 

SEE ALSO

hypot(3m), intro(3m), sinh(3m)

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