OAR

RTEMS GNU Tools On-Line Library


Math

prev UP NEXT Bookshelf

Chapter 1: Mathematical Functions (`math.h')

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.

  1. The representation of infinity as a double is defined as HUGE_VAL; this number is returned on overflow by many functions.
  2. The structure 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 syscalls, 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'.

  • version Version of library
  • acos Arccosine
  • acosh Inverse hyperbolic cosine
  • asin Arcsine
  • asinh Inverse hyperbolic sine
  • atan Arctangent
  • atan2 Arctangent of y/x
  • atanh Inverse hyperbolic tangent
  • jN Bessel functions (jN, yN)
  • cbrt Cube root
  • copysign Sign of Y, magnitude of X
  • cosh Hyperbolic cosine
  • erf Error function (erf, erfc)
  • exp Exponential
  • expm1 Exponential of x, - 1
  • fabs Absolute value (magnitude)
  • floor Floor and ceiling (floor, ceil)
  • fmod Floating-point remainder (modulo)
  • frexp Split floating-point number
  • gamma Logarithmic gamma function
  • hypot Distance from origin
  • ilogb Get exponent
  • infinity Floating infinity
  • isnan Check type of number
  • ldexp Load exponent
  • log Natural logarithms
  • log10 Base 10 logarithms
  • log1p Log of 1 + X
  • matherr Modifiable math error handler
  • modf Split fractional and integer parts
  • nan Floating Not a Number
  • nextafter Get next representable number
  • pow X to the power Y
  • remainder remainder of X divided by Y
  • scalbn scalbn
  • sin Sine or cosine (sin, cos)
  • sinh Hyperbolic sine
  • sqrt Positive square root
  • tan Tangent
  • tanh Hyperbolic tangent

  • prev UP NEXT Bookshelf

    Packaging copyright © 1988-2000 OAR Corporation
    Context copyright by each document's author. See Free Software Foundation for information.