Modula-2 ||
Compiler & Tools ||
Library ||
Search Engine
Ulm's Modula-2 Library:
MathLib
NAME
MathLib - mathematical library
SYNOPSIS
PROCEDURE arctan(x: REAL) : REAL;
PROCEDURE exp(x: REAL) : REAL;
PROCEDURE ln(x: REAL) : REAL;
PROCEDURE sin(x: REAL) : REAL;
PROCEDURE cos(x: REAL) : REAL;
PROCEDURE sqrt(x: REAL) : REAL;
DESCRIPTION
Arctan
returns the arc tangent of
x
in the range -pi/2 to pi/2.
Exp
returns the exponential function of
x.
Ln
returns the natural logarithm of
x.
Sin
and
cos
return trigonometric functions of radian arguments.
Sqrt
returns the square root of
x.
DIAGNOSTICS
The routines may return NaN (not-a-number) in case
of domain errors or plus or minus infinity if the result
value cannot be represented as REAL.
Note that NaNs can be easily checked for by
testing for equality on itself (returns FALSE), and
plus infinity is larger than MAX(REAL).
These checks, however, are not portable to platforms
which do not conform to IEEE 754.
SEE ALSO
Functions, StdFuncs
HISTORY
A similar module named MathLib0 was written by
Niklaus Wirth for the Lilith system.
The current implementation has been derived
by Andreas Borchert
from the GNU C Library
which itself has been partially derived from sources of
the Regents of the University of California.
The only exception is sqrt which is implemented
on base of SYSTEM.SQRT.
Edited by: borchert, last change: 1997/02/25, revision: 1.2, converted to HTML: 1997/04/28
Modula-2 ||
Compiler & Tools ||
Library ||
Search Engine