Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ intro(3M) — SunOS 3.2/SYS4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

INTRO(3M)  —  MATHEMATICAL FUNCTIONS

NAME

intro − introduction to mathematical library functions and constants

SYNOPSIS

#include <sys/ieeefp.h>

#include <floatingpoint.h>

#include <math.h>

DESCRIPTION

The include file <math.h> contains declarations of all the functions described in Section 3M that are implemented in the Math Library, libm.  Functions in this library are automatically loaded as needed by the Fortran and Pascal compilers f77(1) and pc(1); C programs should be linked with the the “−lm” option in order to use this library.

<sys/ieeefp.h> and <floatingpoint.h> define certain types and constants used for libm exception handling conforming to ANSI/IEEE Std 754-1985, the IEEE Standard for Binary Floating-Point Arithmetic. 

ACKNOWLEDGEMENT

The Sun version of libm is based upon and developed from ideas embodied and codes contained in 4.3 BSD Unix.  Users may be misled by expectations based upon some earlier Unix implementations. 

IEEE ENVIRONMENT

The IEEE Standard specifies modes for rounding direction, precision, and exception trapping, and status reflecting accrued exceptions.  These modes and status constitute the IEEE run-time environment.  On Sun-1’s, Sun-2’s, and Sun-3’s without 68881’s, only the default rounding direction to nearest is available, only the default non-stop exception handling is available, and accrued exception bits are not maintained. 

IEEE EXCEPTION HANDLING

The IEEE Standard specifies exception handling for aint, ceil, floor, irint, remainder, rint, and sqrt, and suggests appropriate exception handling for class, copysign, fabs, finite, fmod, isinf, isnan, ilogb, ldexp, logb, nextafter, scalb, scalbn and signbit, but does not specify exception handling for the other libm functions.  For these other unspecified functions the spirit of the IEEE Standard is generally followed in libm by handling invalid operand, singularity (division by zero), overflow, and underflow exceptions, as much as possible, in the same way they are handled for the fundamental floating-point operations such as addition and multiplication. 

These unspecified functions are usually not quite correctly rounded, may not observe the optional rounding directions, and may not set the inexact exception correctly. 

SYSTEM V EXCEPTION HANDLING

The System V Interface Definition (SVID) specifies exception handling for some libm functions: j0, j1, jn, y0, y1, yn, exp, log, log10, pow, sqrt, hypot, lgamma, sinh, cosh, sin, cos, tan, asin, acos, and atan2.  See matherr(3M) for a discussion of the extent to which Sun libm follows SVID when it is consistent with the IEEE Standard and with hardware efficiency. 

LIST OF FUNCTIONS

NameAppears on PageDescription
 acostrig(3M)inverse trigonometric functions
acoshhyperbolic(3M)inverse hyperbolic function
aintrint(3M)convert to integral value in floating-point format
anintrint(3M)convert to integral value in floating-point format
asintrig(3M)inverse trigonometric function
asinhhyperbolic(3M)inverse hyperbolic function
atantrig(3M)inverse trigonometric function
atan2trig(3M)rectangular to polar conversion
atanhhyperbolic(3M)inverse hyperbolic function
cbrtsqrt(3M)cube root
ceilrint(3M)ceiling function
classieee_functions(3M)classify operand
copysignieee_functions(3M)copy sign bit
costrig(3M)trigonometric function
coshhyperbolic(3M)hyperbolic function
erferf(3M)error function
erfcerf(3M)complementary error function
expexp(3M)exponential function
expm1exp(3M)exp(X)-1
exp2exp(3M)2∗∗X
exp10exp(3M)10∗∗X
fabsieee_functions(3M)absolute value function
finiteieee_functions(3M)test for finite number
floorrint(3M)floor function
fmodieee_functions(3M)floating-point remainder
frexpfrexp(3M)floating-point analysis
hypothypot(3M)Euclidean distance
ieee_flagsieee_flags(3M)IEEE modes and status
ieee_handlerieee_handler(3M)IEEE trapping
ilogbieee_functions(3M)exponent extraction
infinityieee_values(3M)returns double-precision IEEE infinity
irintrint(3M)convert to integral value in integer format
isinfieee_functions(3M)IEEE classification
isnanieee_functions(3M)IEEE classification
isnormalieee_functions(3M)IEEE classification
issubnormalieee_functions(3M)IEEE classification
iszeroieee_functions(3M)IEEE classification
j0bessel(3M)Bessel function
j1bessel(3M)Bessel function
jnbessel(3M)Bessel function
ldexpfrexp(3M)exponent adjustment
lgammalgamma(3M)log gamma function
logexp(3M)natural logarithm
logbieee_test(3M)exponent extraction
log1pexp(3M)log(1+X)
log2exp(3M)log base 2
log10exp(3M)common logarithm
matherrmatherr(3M)math library exception-handling routines
max_normalieee_values(3M)returns double-precision IEEE largest positive normalized number
max_subnormalieee_values(3M)returns double-precision IEEE largest positive subnormal number
min_normalieee_values(3M)returns double-precision IEEE smallest positive normalized number
min_subnormalieee_values(3M)returns double-precision IEEE smallest positive subnormal number
modffrexp(3M)floating-point analysis
nextafterieee_functions(3M)IEEE nearest neighbor
nintrint(3M)convert to integral value in integer format
powexp(3M)power X∗∗Y
quiet_nanieee_values(3M)returns double-precision IEEE quiet NaN
remainderieee_functions(3M)floating-point remainder
rintrint(3M)convert to integral value in floating-point format
scalbieee_test(3M)exponent adjustment
scalbnieee_functions(3M)exponent adjustment
signaling_nanieee_values(3M)returns double-precision IEEE signaling NaN
signbitieee_functions(3M)IEEE sign bit test
significandieee_test(3M)scalb(x,-ilogb(x))
sintrig(3M)trigonometric function
sincostrig(3M)simultaneous sin and cos
single_precisionsingle_precision(3M)Single-precision libm access
sinhhyperbolic(3M)hyperbolic function
sqrtsqrt(3M)square root
tantrig(3M)trigonometric function
tanhhyperbolic(3M)hyperbolic function
y0bessel(3M)Bessel function
y1bessel(3M)Bessel function
ynbessel(3M)Bessel function
 

Sun Release 3.2  —  Last change: 20 October 1987

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