Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

INTRO(3M)  —  MATHEMATICAL LIBRARY

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.  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, which may not be compatible with earlier BSD or 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-2 and Sun-3 systems  without 68881 floating-point co-processors, 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 fp_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’s implementation of libm follows the SVID when it is consistent with the IEEE Standard and with hardware efficiency. 

LIST OF MATH LIBRARY FUNCTIONS

Name Appears on Page Description
−bessel(3M)Bessel functions
−frexp(3M) floating-point analysis
−hyperbolic(3M)hyperbolic functions
−ieee_functions(3M)IEEE classification
−ieee_test(3M)IEEE tests for compliance
−ieee_values(3M)returns double-precision IEEE infinity
−trig(3M)  trigonometric functions
acos()trig(3M)inverse trigonometric functions
acosh()hyperbolic(3M)inverse hyperbolic function
aint()rint(3M)convert to integral value in floating-point format
anint()rint(3M)convert to integral value in floating-point format
asin()trig(3M)inverse trigonometric function
asinh()hyperbolic(3M)inverse hyperbolic function
atan()trig(3M)inverse trigonometric function
atan2()trig(3M)rectangular to polar conversion
atanh()hyperbolic(3M)inverse hyperbolic function
cbrt()sqrt(3M)cube root
ceil()rint(3M)ceiling function
convert_external()convert_external(3M) convert between binary formats
copysign()ieee_functions(3M)copy sign bit
cos()trig(3M)trigonometric function
cosh()hyperbolic(3M)hyperbolic function
erf()erf(3M)error function
erfc()erf(3M)complementary error function
exp()exp(3M)exponential function
expm1()exp(3M)exp(X)-1
exp2()exp(3M)2∗∗X
exp10()exp(3M)10∗∗X
fabs()ieee_functions(3M)absolute value function
finite()ieee_functions(3M)test for finite number
floor()rint(3M)floor function
fmod()ieee_functions(3M)floating-point remainder
fp_class()ieee_functions(3M)classify operand
frexp()frexp(3M)floating-point analysis
hypot()hypot(3M)Euclidean distance
ieee_flags()ieee_flags(3M)IEEE modes and status
ieee_handler()ieee_handler(3M)IEEE trapping
ilogb()ieee_functions(3M)exponent extraction
infinity()ieee_values(3M)returns double-precision IEEE infinity
irint()rint(3M)convert to integral value in integer format
isinf()ieee_functions(3M)IEEE classification
isnan()ieee_functions(3M)IEEE classification
isnormal()ieee_functions(3M)IEEE classification
issubnormal()ieee_functions(3M)IEEE classification
iszero()ieee_functions(3M)IEEE classification
j0()bessel(3M)Bessel function
j1()bessel(3M)Bessel function
jn()bessel(3M)Bessel function
ldexp()frexp(3M)exponent adjustment
lgamma()lgamma(3M)log gamma function
log()exp(3M)natural logarithm
logb()ieee_test(3M)exponent extraction
log1p()exp(3M)log(1+X)
log2()exp(3M)log base 2
log10()exp(3M)common logarithm
matherr()matherr(3M)math library exception-handling routines
max_normal()ieee_values(3M)double-precision IEEE largest positive normalized number
max_subnormal()ieee_values(3M)double-precision IEEE largest positive subnormal number
min_normal()ieee_values(3M)double-precision IEEE smallest positive normalized number
min_subnormal()ieee_values(3M)double-precision IEEE smallest positive subnormal number
modf()frexp(3M)floating-point analysis
nextafter()ieee_functions(3M)IEEE nearest neighbor
nint()rint(3M)convert to integral value in integer format
pow()exp(3M)power X∗∗Y
quiet_nan()ieee_values(3M)returns double-precision IEEE quiet NaN
remainder()ieee_functions(3M)floating-point remainder
rint()rint(3M)convert to integral value in floating-point format
scalb()ieee_test(3M)exponent adjustment
scalbn()ieee_functions(3M)exponent adjustment
signaling_nan()ieee_values(3M)returns double-precision IEEE signaling NaN
signbit()ieee_functions(3M)IEEE sign bit test
significand()ieee_test(3M)scalb(x,-ilogb(x))
sin()trig(3M)trigonometric function
sincos()trig(3M)simultaneous sin and cos
single_precision()single_precision(3M) single-precision libm access
sinh()hyperbolic(3M)hyperbolic function
sqrt()sqrt(3M)square root
tan()trig(3M)trigonometric function
tanh()hyperbolic(3M)hyperbolic function
y0()bessel(3M)Bessel function
y1()bessel(3M)Bessel function
yn()bessel(3M)Bessel function

Sun Release 4.1  —  Last change: 20 January 1988

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