Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ math.h(7) — AIX/RT 2.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

matherr

values.h

math.h

Purpose

     Defines math subroutines and constants.

Synopsis

     #include <math.h>

Description

     This header file contains declarations of all the subrou-
     tines in the Math Library (libm.a) and of various subrou-
     tines  in the  Standard  C Library  (libc.a) that  return
     floating-point values.

     It defines  the structure  and constants for  the matherr
     error-handling  mechanism used  by the  math subroutines.
     (See "matherr" for details about this mechanism.)

     Among  other things,  math.h defines  the following  con-
     stant, which is used as an error-return value:

     HUGE         The  maximum  value  of  a  single-precision
                  floating-point number.

     If you  define the  _C_func preprocessor  variable before
     including math.h,  then math.h  defines macros  that make
     the names of certain math  subroutines appear to the com-
     piler as  _C_xxxx.  The following names  are redefined to
     have a _C_ prefix:

         exp                                       tan
         log                                       asin
         log10                                     acos
         sqrt                                      atan
         sin                                       atan2
         cos

These special names instruct the C  compiler to generate code that avoids the
overhead of the math library subroutines and issues compatible-mode floating-
point calls directly.  See "fpfp" for information about compatible mode.

The following mathematical constants are also defined for your convenience:

M_E          The base of natural logarithms (e)

M_LOG2E      The base-2 logarithm of e (log[2] e)

M_LOG10E     The base-10 logarithm of e (log[10] e)

M_LN2        The natural logarithm of 2 (log[e] 2)

M_LN10       The natural logarithm of 10 (log[e] 10)

M_PI         &pi., the ratio of the circumference of a circle to its diameter

M_PI_2       The value of &pi. / 2

M_PI_4       The value of &pi. / 4

M_1_PI       The value of 1 / &pi.

M_2_PI       The value of 2 / &pi.

M_2_SQRTPI   The value of 2 divided by the positive square root of &pi.

M_SQRT2      The positive square root of 2

M_SQRT1_2    The positive square root of 1/2.

The math.h  file contains  an #include statement  that imbeds  another header
file named values.h.  This header  file defines a number of machine-dependent
constants, and it is discussed on page 7-71.

Files

/usr/include/math.h
/usr/include/values.h

Related Information

In this book:  "matherr" and "values.h."

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