intro_libm(3I)

INTRO_LIBM - Introduction to math library routines

Showing IRIX 6.5.30 (default release). Last changed in IRIX 6.5.19.

NAME
     INTRO_LIBM - Introduction to math library routines

DESCRIPTION
     The math routines are listed with the other intrinsic procedures in
     alphabetical order, usually by generic function name.  Generic
     function names are function calls that cause the compiler to compile
     automatically the appropriate data type version of a routine, based on
     the type of the input data.  For example, a call to the generic
     function LOG with a type of input data of complex compiles as CLOG.

     For information on inlining and vectorization of the Fortran 95
     intrinsic procedures, see INTRO_INTRIN(3I).

     The math routines can be divided into the following general
     categories:

     * General arithmetic functions - In the routine descriptions, complex
       arguments are represented as

       x = xr + ixi.

       The real part of the complex number is xr; xi is the imaginary part.

       Arguments and results are of the same type unless otherwise
       indicated.

       Base values raised to a power and 64-bit integer division are called
       implicitly from Fortran.

     * Exponential and logarithmic functions - These functions are similar
       to the ANSI standard functions.  Each function has variations for
       real, double precision, and complex values except the common
       logarithm function, which addresses only real and double-precision
       values.  Complex arguments are represented as

       x = xr + ixi.

       xr is the real part of the complex number; xi is the imaginary part.

     * Trigonometric functions - The trigonometric functions are based on
       the ANSI standard for Fortran, except for the cotangent function and
       the COSS (cosine and sine) function, which are extensions.

     * Type conversion functions - Type conversion functions change the
       type of an argument.  In the routine description, complex arguments
       are represented as

       x = xr + ixi.

       xr is the real part of the complex number; xi is the imaginary part.

       Arguments and results are of the same type, unless indicated
       otherwise.

     * Boolean functions - The Boolean functions perform logical operations
       and bit manipulations.

     Calling from Fortran programs
     Some function names are in uppercase, and some are in lowercase.  The
     Fortran language is case-insensitive but the compiler maps all code in
     uppercase.  This means that functions with lowercase names cannot be
     called from Fortran programs.

     Calling from C programs
     The C language is case-sensitive.  You must use the exact case
     specified in the documentation when coding references to a function.

     The following rules can be used:

     * Because the function is not declared in a Standard C header,
       explicitly declare the function as external, and specify the type of
       the return value.

     * When calling the function, pass the address of the arguments by
       using the address operator (&) for each argument or by using a
       pointer to the argument.  Array names are considered to be
       addresses; the address operator is not needed when using them.

     * The value returned by the function is the value, rather than the
       address of the value.

     * Specify the fortran keyword.  The fortran keyword is an extension to
       the C language and is useful when a C program calls a function
       following the Fortran calling sequence.  Specifying the fortran
       keyword causes the C compiler to verify that the arguments used in
       each call to the function are pass-by-address.

     Register conventions
     The documentation for some of the widely used user-callable functions
     contains the register usage convention for the function.  By default
     all the Fortran compilers use the call-by-register convention for math
     library functions (it is the fastest calling sequence), and will put
     the % prefix or suffix on the function name where needed.  If a math
     library function is declared EXTERNAL or INTRINSIC, the compilers will
     generate code for the call-by-address method.

SEE ALSO
     INTRO_INTRIN(3I)

     CF90 Commands and Directives Reference Manual

     MIPSpro Fortran Language Reference Manual, Volume 1

     MIPSpro Fortran Language Reference Manual, Volume 2

     MIPSpro Fortran Language Reference Manual, Volume 3