VMS Help
PASCAL, Predeclared Routines, Arithmetic
*Conan The Librarian (sorry for the slow response - running on an old VAX)
|
|
Arithmetic routines perform mathematical computations. Actual
parameters to the arithmetic functions can be of any arithmetic
type.
The ABS function returns a value (of the same data type as the
specified parameter) that is the absolute value of the
parameter.
Syntax:
ABS( x )
The parameter 'x' can be of any arithmetic type.
The ARCTAN function returns a real value that expresses in
radians the arctangent of the specified parameter.
Syntax:
ARCTAN( x )
The parameter 'x' can be an integer or REAL type.
The COS function returns a real value that represents the cosine
of the specified parameter.
Syntax:
COS( x )
The parameter 'x' can be an integer or REAL type, and is
expressed in radians.
The EXP function returns a real value that represents the
exponent of the specified parameter (it represents e**x).
Syntax:
EXP( x )
The parameter 'x' can be an integer or REAL type.
The LN function returns a real value that represents the natural
logarithm of the specified parameter.
Syntax:
LN( x )
The parameter 'x' can be an integer or REAL type. The value of
'x' must be greater than zero.
The LSHIFT and LSHFT predeclared functions return a value of the
same type as its first parameter. The return value represents
the value of the first parameter after the bits have been
shifted to the left.
Syntax:
LSHIFT(expression,expression)
LSHFT(expression,expression)
The parameters are two integer or unsigned values. The first
parameter represents a value to shift. The second parameter
represents the number of bits to shift the first value to the
left. LSHIFT and LSHFT insert zero bits on the right as the
bits shift left.
Note that shifting integers is not equivalent to multiplying or
dividing by a power of two when the value of the integer is
negative.
If the number of bits shifted is larger than the natural integer
size of the target platform, the result is undefined.
The MAX function returns a value (the same type as that of the
parameters) that is the maximum value of a specified list of
parameters.
Syntax:
MAX( x1,...,xn )
The parameters can be any arithmetic type, but must all be of
the same type.
The MIN function returns a value (of the same type as that of
the parameters) that is the minimum value of a specified list of
parameters.
Syntax:
MIN( x1,...,xn )
The parameters can be any arithmetic type, but must all be of
the same type.
The RSHIFT and RSHFT predeclared functions return a value of the
same type as its first parameter. The value represents the
value of the first parameter after the bits have been shifted to
the right.
Syntax:
RSHIFT(expression,expression)
RSHFT(expression,expression)
The parameters are two integer or unsigned values. The first
parameter represents a value to shift; the second represents the
number of bits to shift the first value. The RSHIFT and RSHFT
functions insert zero bits on the left as the bits shift right.
Note that shifting integers is not equivalent to multiplying or
dividing by a power of two when the value of the integer is
negative.
If the number of bits shifted is larger than the natural integer
size of the target platform, the result is undefined.
The SIN function returns a real value that represents the sine
of the specified parameter.
Syntax:
SIN( x )
The parameter 'x' can be an integer or REAL type, and is
expressed in radians.
The SQR function returns a value (of the same type of the
parameter) that represents the square of the specified
parameter.
Syntax:
SQR( x )
The parameter 'x' can be of any arithmetic type.
The SQRT function returns a real value that represents the
square root of the specified parameter.
Syntax:
SQRT( x )
The parameter 'x' can be of an integer, unsigned, or REAL type.
If the value of 'x' is less than zero, an error occurs.
The UAND function returns an unsigned value that represents a
binary logical AND operation on each corresponding pair of bits
of the specified parameters.
Syntax:
UAND( u1,u2 )
The parameters 'u1' and 'u2' must be unsigned.
The UNOT function returns an unsigned value that represents a
binary logical NOT operation on each bit of the specified
parameter.
Syntax:
UNOT( u1 )
The parameter 'u' must be unsigned.
The UOR function returns an unsigned value of a binary logical
OR operation on the corresponding pair of bits of two specified
parameters.
Syntax:
UOR( u1,u2 )
The parameters 'u1' and 'u2' must be unsigned.
The UXOR function returns an unsigned value of a binary logical
exclusive-OR operation on the corresponding pair of bits of two
specified parameters.
Syntax:
UXOR( u1,u2 )
The parameters 'u1' and 'u2' must be unsigned.
The XOR function returns a value (of the same type as the
parameters) of a binary logical exclusive-OR operation on two
specified parameters.
Syntax:
XOR( p1,p2 )
The 'p1' and 'p2' parameters must be of the same type and must
be of either the BOOLEAN or SET types.
[legal]
[privacy]
[GNU]
[policy]
[netiquette]
[sponsors]
[FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.