Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

intro(2)

hypot(3M)

sinh(3M)

fpsignal(3C)

EXP(3M)  —  Silicon Graphics

NAME

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

SYNOPSIS

#include <math.h>

float exp (x)
float x;

long float _lexp (x)
long float x;

float log (x)
float x;

long float _llog (x)
long float x;

float log10 (x)
float x;

long float _llog10 (x)
long float x;

float pow (x, y)
float x, y;

long float _lpow (x, y)
long float x, y;

float up_i (x,y)
float x;
int y;

float sqrt (x)
float x;

long float _lsqrt (x)
long float x;

DESCRIPTION

Exp and _lexp return ex.

Log, and _llog return the natural logarithm of x. The value of x must be positive. 

Log10 and _llog10 return the logarithm base ten of x. The value of x must be positive. 

Pow, _lpow, and up_i return xy. If x is zero, y must be positive.  In the case of _lpow, if x is non-positive, y must be an integer. 

Sqrt and _lsqrt return the square root of x. The value of x may not be negative. 

The long float versions of these functions receive and return long float values.  As shown above, they are named by prefixing the single precision function name with _l. 

DIAGNOSTICS

Certain input values cause a floating point exception to be raised using the standard handling procedure described in fpsignal(3c). In the cases described below, the global _mathfunc_id is set to indicate the function which raised the exception, and the operation is set to MATH. All of the functions detect arguments of Nan or ∞, raising a floating point exception with the type INVALID_OP_A or INVALID_OP_F2, respectively. 

If the argument would cause exp (_lexp) to overflow (underflow), a floating point exception is raised with the type set to OVERFL or UNDERFL, respectively. 

Log (_llog) and log10 (_llog10) raise an exception with the type DOMAIN_ERROR if the argument is < 0. 

Similarly to exp and _lexp, Pow, _lpow, and up_i check for values which would overflow or underflow.  Additionally, pow and _lpow check for the special case of zero raised to a non-positive power, causing a floating point exception with the type DOMAIN_ERROR. _lpow also raises an exception of type DOMAIN_ERROR if its second argument is less than zero and not integral (i.e., (long float)(long)arg2 ≠ arg2.).  The single precision version pow will accept a non-integral second argument in all cases. 

Sqrt and _lsqrt raise an exception with the type DOMAIN_ERROR if their argument is less than zero. 

SEE ALSO

intro(2), hypot(3M), sinh(3M), fpsignal(3C). 

Version 2.3  —  July 04, 1985

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