Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ Intro(3M) — SPARCworks 2.0.1

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 −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. 

SYSTEM V EXCEPTION HANDLING

The System V Interface Definition ( SVID ) specifies exception handling for some libm functions: j0(), j1(), jn(), y0(), y1(), yn(), exp(), fmod(), log(), log10(), pow(), sqrt(), scalb(), hypot(), lgamma(), remainder(), sinh(), cosh(), sin(), cos(), tan(), asin(), acos(), asinh(), acosh(), atanh(), and atan2(). 

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. 

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. 

LIST OF MATH LIBRARY FUNCTIONS

Name Appears on Page Description
−addrans(3M)additive pseudo-random number generators
−bessel(3M)Bessel functions
−hyperbolic(3M)hyperbolic functions
−ieee_functions(3M)IEEE classification
−ieee_test(3M)IEEE tests for compliance
−ieee_values(3M)returns double-precision IEEE extreme values
−lcrans(3M)linear congruential pseudo-random number generators
−shufrans(3M)random number shufflers
−trig(3M)  trigonometric functions
acos()trig(3M)inverse trigonometric functions
acosd()trig(3M)inverse trigonometric functions
acosh()hyperbolic(3M)inverse hyperbolic function
acosp()trig(3M)inverse trigonometric functions
acospi()trig(3M)inverse trigonometric functions
aint()floor(3M)convert to integral value in floating-point format
anint()floor(3M)convert to integral value in floating-point format
asin()trig(3M)inverse trigonometric function
asind()trig(3M)inverse trigonometric function
asinh()hyperbolic(3M)inverse hyperbolic function
asinp()trig(3M)inverse trigonometric function
asinpi()trig(3M)inverse trigonometric function
atan()trig(3M)inverse trigonometric function
atan2()trig(3M)rectangular to polar conversion
atan2d()trig(3M)rectangular to polar conversion
atan2pi()trig(3M)rectangular to polar conversion
atand()trig(3M)inverse trigonometric function
atanh()hyperbolic(3M)inverse hyperbolic function
atanp()trig(3M)inverse trigonometric function
atanpi()trig(3M)inverse trigonometric function
cbrt()sqrt(3M)cube root
ceil()floor(3M)ceiling function
convert_external()convert_external(3M) convert between binary formats
copysign()ieee_functions(3M)copy sign bit
cos()trig(3M)trigonometric function
cosd()trig(3M)trigonometric function
cosh()hyperbolic(3M)hyperbolic function
cosp()trig(3M)trigonometric function
cospi()trig(3M)trigonometric function
d_lcran_()lcrans(3M)random number generators
d_lcrans_()lcrans(3M)random number generators
d_addran_()addrans(3M)random number generators
d_addrans_()addrans(3M)random number generators
d_shufrans_()shufrans(3M)random number shufflers
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()floor(3M)floor function
fmod()ieee_functions(3M)floating-point remainder
fp_class()ieee_functions(3M)classify operand
hypot()hypot(3M)Euclidean distance
i_addran_()addrans(3M)random number generators
i_addrans_()addrans(3M)random number generators
i_lcran_()lcrans(3M)random number generators
i_lcrans_()lcrans(3M)random number generators
i_shufrans_()shufrans(3M)random number shufflers
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()floor(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
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
nextafter()ieee_functions(3M)IEEE nearest neighbor
nint()floor(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()floor(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
sincosd()trig(3M)simultaneous sin and cos
sincosp()trig(3M)simultaneous sin and cos
sincospi()trig(3M)simultaneous sin and cos
sind()trig(3M)trigonometric function
single_precision()single_precision(3M) single-precision libm access
sinh()hyperbolic(3M)hyperbolic function
sinp()trig(3M)trigonometric function
sinpi()trig(3M)trigonometric function
sqrt()sqrt(3M)square root
tan()trig(3M)trigonometric function
tand()trig(3M)trigonometric function
tanh()hyperbolic(3M)hyperbolic function
tanp()trig(3M)trigonometric function
tanpi()trig(3M)trigonometric function
u_addrans_()addrans(3M)random number generators
u_lcrans_()lcrans(3M)random number generators
u_shufrans_()shufrans(3M)random number shufflers
y0()bessel(3M)Bessel function
y1()bessel(3M)Bessel function
yn()bessel(3M)Bessel function

Sun Release 4.1  —  Last change: 22 October 1991

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