Chapter Contents |
Previous |
Next |
Function Categories |
The mathematical
functions include a large proportion of the
floating-point math functions usually provided with traditional UNIX C compilers.
The header file
<math.h>
should be
included when using most of these functions. See the individual function descriptions
to determine whether the header file is required for that function.
The library also provides the standard header file
<float.h>
, which provides additional information
about floating-point arithmetic. The contents of this header file are listed
here:
#define FLT_RADIX 16 /* hardware float radix */ #define FLT_ROUNDS 0 /* float addition does not round. */ #define FLT_MANT_DIG 6 /* hex digits in float mantissa */ #define DBL_MANT_DIG 14 /* hex digits in double mantissa */ #define LDBL_MANT_DIG 14 /* hex digits in long double mantissa */ #define FLT_DIG 6 /* float decimal precision */ #define DBL_DIG 16 /* double decimal precision */ #define LDBL_DIG 16 /* long double decimal precision */ #define FLT_MIN_EXP -64 /* minimum exponent of 16 for float */ #define DBL_MIN_EXP -64 /* minimum exponent of 16 for double */ #define LDBL_MIN_EXP -64 /* minimum exponent of 16 for long */ /* double */ #define FLT_MIN_10_EXP -78 /* minimum float power of 10 */ #define DBL_MIN_10_EXP -78 /* minimum double power of 10 */ #define LDBL_MIN_10_EXP -78 /* minimum long double power of 10 */ #define FLT_MAX_EXP 63 /* maximum exponent of 16 for float */ #define DBL_MAX_EXP 63 /* maximum exponent of 16 for double */ #define LDBL_MAX_EXP 63 /* maximum exponent of 16 for long */ /* double */ #define FLT_MAX_10_EXP 75 /* maximum float power of 10 */ #define DBL_MAX_10_EXP 75 /* maximum double power of 10 */ #define LDBL_MAX_10_EXP 75 /* maximum long double power of 10 */ #define FLT_MAX .7237005e76F /* maximum float */ #define DBL_MAX .72370055773322621e76 /* maximum double */ #define LDBL_MAX .72370055773322621e76L /* maximum long double */ /* smallest float x such that 1.0 + x != 1.0 */ #define FLT_EPSILON .9536743e-6F /* smallest double x such that 1.0 + x != 1.0 */ #define DBL_EPSILON .22204460492503131e-15 /* smallest long double x such that 1.0 - x != 1.0 */ #define LDBL_EPSILON .22204460492503131e-15L #define FLT_MIN .5397606e-78F /* minimum float */ #define DBL_MIN .53976053469340279e-78 /* minimum double */ #define LDBL_MIN .53976053469340279e-78L /* minimum long double */
Additionally, the header file
<lcmath.h>
declares useful mathematical constants, as listed in
Constant Values Declared in lcmath.h.
In Constant Values Declared in lcmath.h,
math.h
defines the value
HUGE_VAL
, which is an ANSI-defined symbol with the same value.
The following are mathematical functions:
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.