@(#)mathlib.txt, SozobonX library docs Feb 14 1995

The Floating Point Math Library

     The floating point math library for Sozobon C 2.00X with hcc Pl >24
is the 'pml' portable math library by Fred Fish. It is distributed as
a file 'libm.a'. To make use of the functions you will have to include
the (new) 'math.h' file. To get functions linked from 'libm.a'
specify '-lm'. The ident string variable __Ident_libm is added to your
binary then.

Functions:
     acos()                acosh()
     asin()                asinh()
     atan()                atan2()               atanh()
     cabs()                ceil()
     cos()                 cosh()
     dabs()                fabs()                exp()
     fmod()                floor()
     log()                 log10()
     matherr()             max()                 min()
     pmlcfs()              pmlcnt()              pmlerr()
     pmllim()              pmlsfs()
     poly()                pow()
     rint()                sign()
     sin()                 sinh()
     sqrt()                tan()                 tanh()


__Ident_libm
 char __Ident_libm[]

 An 'ident' string for the XdLibs math 
 library 'libm.a'. Automatically linked.

acos()
     double acos(double x)

     Returns double precision arc cosine of double precision
     floating point argument.


acosh()
     double acosh(double x)

     Returns double precision hyperbolic arc cosine of double precision
     floating point number.


asin()
     double asin(double x)

     Returns double precision arc sine of double precision
     floating point argument.

     If argument is less than -1.0 or greater than +1.0, calls
     matherr with a DOMAIN error.  If matherr does not handle
     the error then prints error message and returns 0.


asinh()
     double asinh(double x)

     Returns double precision hyperbolic arc sine of double precision
     floating point number.


atan()
     double atan(double x)

     Returns double precision arc tangent of double precision
     floating point argument.


atan2()
     double atan2(double x, double y)

     Returns double precision arc tangent of two
     double precision floating point arguments ( atan(Y/X) ).


atanh()
     double atanh(double x)

     Returns double precision hyperbolic arc tangent of double precision
     floating point number.


cabs()
     double cabs(COMPLEX z)

     Computes double precision absolute value of a double
     precision complex argument, where "absolute value"
     is taken to mean magnitude.  The result replaces the
     argument.

ceil()
     double ceil(double x)

     Round x up to the next larger whole number.


cos()
     double cos(double x)

     Returns double precision cosine of double precision
     floating point argument.


cosh()
     double cosh(double x)

     Returns double precision hyperbolic cosine of double precision
     floating point number.


dabs()
    double dabs(double x)

     Returns absolute value of double precision number.


fabs()
    double fabs(double x)

     Returns absolute value of double precision number.


exp()
     double exp(double x)

     Returns double precision exponential of double precision
     floating point number.


fmod()
     fmod(double value, double base)

     Returns double precision modulo of two double
     precision arguments.


floor()
     double floor(double x)

     Returns largest integer <= x.


log()
     double log(double x)

     Returns double precision natural log of double precision
     floating point argument.


log10()
     double log10(double x)

     Returns double precision common log of double precision
     floating point argument.


matherr()
     int matherr(struct exception *xcpt)

     Default math error handler for the math library.  This routine
     may be replaced by one of the user's own handlers.  The default
     is to do nothing and returns zero.  If the user wishes to supply
     the return value for the function, and to suppress default
     error handling by the function, his matherr routine must return
     non-zero.


max()
     double max(double x, double y)

     Returns maximum value of two double precision numbers.


min()
     double min(double x, double y)

     Returns minimum value of two double precision numbers.


pmlcfs()
     int pmlcfs(int err_code, int flags)

     Clear the specified PML error handler flags for the
     specified error.  Two or more flags may be cleared simultaneously
     by "or-ing" them in the call, for example "LOG | CONTINUE".
     The manifest constants for the flags and error codes are
     defined in <pmluser.h>.


pmlcnt()
     int pmlcnt()

     Returns the total number of PML errors seen
     prior to the call, and resets the error count to zero.


pmlerr()
     int pmlerr (int err_code)

     Provides a sample PML error handler.  Does
     not use any available hardware "traps" so is machine
     independent.  Generally only called internally by the
     other PML routines.

     There are currently three flags which control the
     response for specific errors:

      (1)  LOG      When set an error message is sent
                    to the user terminal.

      (2)  COUNT    When set the error is counted
                    against the PML error limit.

      (3) CONTINUE  When set the task continues
                    providing the error count has not
                    exceeded the PML error limit.

     Each of these flags can be set or reset independently
     by "pmlsfs" or "pmlcfs" respectively.


pmllim()
     int pmllim (int limit)

     Sets the PML error limit to the specified value
     and returns it previous value.
     Does not affect the current error count (which may be reset
     to zero by a call to "pmlcnt").  Note that the default error
     limit is set at compile time by the value in "pml.h".


pmlsfs()
     int pmlsfs(int err_code, int flags)

     Set the specified PML error handler flags for the
     specified error.  Two or more flags may be set simultaneously
     by "or-ing" them in the call, for example "LOG | CONTINUE".
     The manifest constants for the flags and error codes are
     defined in <pmluser.h>.


poly()
     double poly (int order, double *coeffs, double x)

     Evaluates a polynomial and returns double precision
     result.  Is passed a the order of the polynomial,
     a pointer to an array of double precision polynomial
     coefficients (in ascending order), and the independent
     variable.

     Evalates the polynomial using recursion and the form:

          P(x) = P0 + x(P1 + x(P2 +...x(Pn)))


pow()
     double pow(double x, double y)

     Calculate x^y.


rint()
     double rint(double x)

     Returns an integer rounded from a double.  In case of fraction
     exactly midway, round chooses nearest even value.


sign()
     double sign(double x, double y)

     Returns first argument with same sign as second argument.


sin()
     double sin(double x)

     Returns double precision sine of double precision
     floating point argument.


sinh()
     double sinh(double x)

     Returns double precision hyperbolic sine of double precision
     floating point number.

     Inputs greater than ln(MAXDOUBLE) result in overflow.
     Inputs less than ln(MINDOUBLE) result in underflow.


sqrt()
     double sqrt(double x)

     Returns double precision square root of double precision
     floating point argument.


tan()
     double tan(double x)

     Returns tangent of double precision floating point number.

     Computes the tangent from tan(x) = sin(x) / cos(x).

     If cos(x) = 0 and sin(x) >= 0, then returns largest
     floating point number on host machine.

     If cos(x) = 0 and sin(x) < 0, then returns smallest
     floating point number on host machine.


tanh()
     double tanh(double x)

     Returns double precision hyperbolic tangent of double precision
     floating point number.

-eof
