Copyright (C) 1992, 1993 Cygnus Support
`libm' includes software developed at SunPro, a Sun Microsystems, Inc. business. Permission to use, copy, modify, and distribute this software is freely granted, provided that this notice is preserved.
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, subject to the terms of the GNU General Public License, which includes the provision that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.
This chapter groups a wide variety of mathematical functions. The corresponding definitions and declarations are in `math.h'. Two definitions from `math.h' are of particular interest.
double
is defined as
HUGE_VAL
; this number is returned on overflow by many functions.
exception
is used when you write customized error
handlers for the mathematical functions. You can customize error
handling for most of these functions by defining your own version of
matherr
; see the section on matherr
for details.
Since the error handling code calls fputs
, the mathematical
subroutines require stubs or minimal implementations for the same list
of OS subroutines as fputs
: close
, fstat
,
isatty
, lseek
, read
, sbrk
, write
.
See section `System Calls' in The Cygnus C Support Library,
for a discussion and for sample minimal implementations of these support
subroutines.
Alternative declarations of the mathematical functions, which exploit specific machine capabilities to operate faster--but generally have less error checking and may reflect additional limitations on some machines--are available when you include `fastmath.h' instead of `math.h'.
Go to the first, previous, next, last section, table of contents.