Summary:
See also: Built-in Functions
The Math class provides mathematical functions.
This API is provided as a Dynamic C Extension library; it is part of the standard package.
To use this extension, you must import the util package in your program:
IMPORT util
The Math class is a provides an interface for mathematical functions.
util.Math
Class Methods | |
Name | Description |
sqrt | This function computes the square root of its argument. |
pow | This function computes the value of x raised to the power y. |
exp | This function computes the base- e exponential of x. |
srand | This function intializes the pseudo-random number generator. |
rand | This function returns a pseudo-random number. |
sin | This function computes the sine of their argument x, measured in radians. |
cos | This function computes the cosine of their argument x, measured in radians. |
tan | This function computes the tangent of their argument x, measured in radians. |
asin | This function computes the arc sine of their argument x, measured in radians. |
acos | This function computes the arc cosine of their argument x, measured in radians. |
atan | This function computes the arc tangent of their argument x, measured in radians. |
log | This function computes the natural logarithm of the argument x. |
toDegrees | Converts an angle measured in radians to an equivalent angle measured in degrees. |
toRadians | Converts an angle measured in degrees to an equivalent angle measured in radians. |
pi | This function returns the FLOAT value of PI. |
Returns the square root of the argument provided.
CALL util.Math.sqrt(FLOAT f) RETURNING rv FLOAT
This function computes the value of x raised to the power y.
CALL util.Math.pow(FLOAT x, FLOAT y) RETURNING rv FLOAT
This function computes the base- e exponential of x.
CALL util.Math.exp(FLOAT x) RETURNING rv FLOAT
This function initializes the pseudo-random numbers generator.
CALL util.Math.srand()
This function returns a pseudo-random number between 0 and x
CALL util.Math.rand(x INTEGER) RETURNING rv INTEGER
This function computes the sine of the argument x, measured in radians.
CALL util.Math.sin(FLOAT f) RETURNING rv FLOAT
This function computes the cosine of the argument x, measured in radians.
CALL util.Math.cos(FLOAT f) RETURNING rv FLOAT
This function computes the tangent of the argument x, measured in radians.
CALL util.Math.tan(FLOAT f) RETURNING rv FLOAT
This function computes the arc sine of the argument x, measured in radians.
CALL util.Math.asin(FLOAT f) RETURNING rv FLOAT
This function computes the arc cosine of the argument x, measured in radians.
CALL util.Math.acos(FLOAT f) RETURNING rv FLOAT
This function computes the arc tangent of the argument x, measured in radians.
CALL util.Math.atan(FLOAT f) RETURNING rv FLOAT
This function computes the natural logarithm of the argument x.
CALL util.Math.log(FLOAT f) RETURNING rv FLOAT
Converts an angle measured in radians to an approximately equivalent angle measured in degrees.
CALL util.Math.toDegrees(FLOAT f) RETURNING rv FLOAT
Converts an angle measured in degrees to an approximately equivalent angle measured in radians.
CALL util.Math.toRadians(FLOAT f) RETURNING rv FLOAT
This function returns the FLOAT value of PI.
CALL util.Math.pi() RETURNING rv FLOAT