HP-UX Floating-Point Guide

114 Chapter 4
HP-UX Math Libraries on HP 9000 Systems
Contents of the HP-UX Math Libraries
The C Math Library (libm)
The C math library, libm, provides all the math functions specified by
the ANSI C standard. It also provides
float versions of many mathematical functions
Degree-valued trigonometric functions
A group of functions and macros recommended by the IEEE standard
(see Table 2-12 on page 67), including floating-point classification
macros, and some additional classification macros that the ISO/ANSI
C committee has included in the C9X draft standard, the proposed
new C standard
A group of functions required by the COSE Common API
Specification (Spec 1170) and by the XPG4.2 specification
The fenv(5) suite, a collection of functions that allow an application to
manipulate the floating-point status register. The ISO/ANSI C
committee has included these functions in the C9X draft standard.
Additional functions and macros that the ISO/ANSI C committee has
included in the C9X draft standard
All of these functions are declared in math.h or fenv.h. However, many
are not specified by the current ANSI C standard. If you compile in strict
ANSI mode (with the -Aa option), only the declarations of functions
specified by the ANSI C standard are ordinarily visible to your program.
Therefore, to make the additional functions visible, do one of the
following:
Compile with the extended ANSI option -Ae, which makes both ANSI
and non-ANSI function declarations visible. This option is the
default, so you need not specify it explicitly:
cc program_name.c -lm
If your program does not use ANSI C features, compile in
compatibility mode (with the -Ac option), which also makes both
ANSI and non-ANSI function declarations visible:
cc -Ac program_name.c -lm
Do not use this option to compile programs that call float type math
functions, because they depend on ANSI C features. See “float Type
Math Functions” on page 115.