Tivoli Service Desk 6.0 Developer's Toolkit Script Language Reference

Math Functions

Return to Main Page


ACos

Description

Returns the arc cosine of a given expression between -1.0 and 1.0, in degrees.

Syntax

FUNCTION ACos (VAL u: REAL): REAL;

Argument Notes

Argument Name Description
u The input expression. Must have a value between -1.0 and 1.0.

Example

VARIABLES
r: Real;
ACTIONS
r:=ACos(0.5);

ASin

Description

Returns the arc sine of an expression between -1.0 and 1.0 in degrees.

Syntax

FUNCTION ASin (VAL u: REAL): REAL;

Argument Notes

Argument Name Description
u The input expression. Must have a value between -1.0 and 1.0.

Example

VARIABLES
r: REAL;
ACTIONS
r:=ASin(-0.7);

ATan

Description

Returns the arc tangent of a given expression between -1.0 and 1.0 in degrees.

Syntax

FUNCTION ATan (VAL u: REAL): REAL;

Argument Notes

Argument Name Description
u The input expression. Must have a value between -1.0 and 1.0.

Example

VARIABLES
r: REAL;
ACTIONS
r:=ATan(.5);

Cos

Description

Returns the cosine of an angle measured in degrees.

Syntax

FUNCTION Cos (VAL u: REAL): REAL;

Argument Notes

Argument Name Description
u An input angle measured in degrees

Example

VARIABLES
r: REAL;
ACTIONS
r:=Cos(180);

CosH

Description

Calculates the hyperbolic cosine of a numeric expression and returns the result as a real number in degrees.

Syntax

FUNCTION CosH (VAL u: REAL): REAL;

Argument Notes

Argument Name Description
u A real-value expression

Example

VARIABLES
r: REAL;
ACTIONS
r:=CosH(0.5);

Exp

Description

This statement computes the exponential function of its argument.

Syntax

FUNCTION Exp (VAL u: REAL): REAL;

Argument Notes

Argument Name Description
u Real-value expression to be treated as an exponent of e

Notes

Calculates e to a given power and returns the result as a real number.

Example

VARIABLES
r: REAL;
ACTIONS
r:=Exp(2.0);

Return Codes

Exp does not return any codes. It returns the exponential of a finite argument (e raised to a given power, where e is the base of the natural logarithm). If the computation overflows the underlying double precision floating point value, the result is undefined.


Ln

Description

Returns the natural log of a number.

Syntax

FUNCTION Ln (VAL u: REAL): REAL;

Argument Notes

Argument Name Description
u A real-value positive expression

Notes

Calculates the natural log of the argument, which must be a positive number.

Example

VARIABLES
r: REAL;
ACTIONS
r:=Ln(3);

Return Codes

Return Code Description
any Natural log of argument

See Also

Log


Log

Description

Returns the common logarithm (base 10) of a number.

Syntax

FUNCTION Log (VAL u: REAL): REAL;

Argument Notes

Argument Name Description
u A real-value positive expression

Notes

Returns the common logarithm (base 10) of the input expression. Note that Log(x)=y is the same as Power(10,y)x.

Example

VARIABLES
r: REAL;
ACTIONS
r:=Log(2);

Return Codes

Return Code Description
any Common (base 10) logarithm of argument.

See Also

Ln


Power

Description

Returns the result of raising a number to a given power.

Syntax

FUNCTION Power (VAL u: REAL, VAL v: REAL): REAL;

Argument Notes

Argument Name Description
u The number to be exponentiated.
V The exponent.

Example

VARIABLES
r: REAL;
ACTIONS
r:=Power(2,8);

Return Codes

Return Code Description
Any The result of raising a number to a given power

Random

Description

Generates a random number in a given range.

Syntax

FUNCTION Random (VAL lo, hi: INTEGER): INTEGER;

Argument Notes

Argument Name Description
lo The low bound for the random number
hi The high bound for the random number

Notes

Returns a random number as an integer between two inclusive boundaries. The random number generator automatically seeds using the system clock.

Example

VARIABLES
guess: INTEGER;
ACTIONS
guess:=Random(1,10);

Return Codes

Return Code Description
Any Function result

Round

Description

Rounds a real-value number to the nearest integer value, using the US rounding algorithm (which adds .5 and then truncates).

Syntax

FUNCTION Round (VAL u: REAL): INTEGER;

Argument Notes

Argument Name Description
u A real-value expression to be rounded

Example

VARIABLES
i: INTEGER;
ACTIONS
i:=Round(3.14);

Return Codes

Return Code Description
Any Rounded return value

Sin

Description

Returns the sine of an input value, expressed in degrees

Syntax

FUNCTION Sin (VAL u: REAL): REAL;

Argument Notes

Argument Name Description
u A real-value expression representing an angle in degrees.

Example

VARIABLES
r: REAL;
ACTIONS
r:=Sin(30.0);

Return Codes

Returns the sine of an input value, expressed in degrees.

See Also

SinH


SinH

Description

Returns the hyperbolic sine of an expression.

Syntax

FUNCTION SinH (VAL u: REAL): REAL;

Argument Notes

Argument Name Description
u The argument to this function is a real valued expression.

Example

VARIABLES
r: REAL;
ACTIONS
r:=SinH(3);

Return Codes

Returns the hyperbolic sine of an expression.


Sqrt

Description

Returns the square root of a number.

Syntax

FUNCTION Sqrt (VAL u: REAL): REAL;

Argument Notes

Argument Name Description
u An expression whose square root is to be calculated. It should be a positive number.

Example

VARIABLES
r: REAL;
ACTIONS
r:=Sqrt(4.0);

Tan

Description

Returns the tangent of an angle, expressed in degrees.

Syntax

FUNCTION Tan (VAL angle: REAL): REAL;

Argument Notes

Argument Name Description
u A real-value expression representing an angle in degrees

Example

VARIABLES
r: REAL;
ACTIONS
r:=Tan(30);

Return Codes

Returns the tangent of an angle, expressed in degrees.

See Also

TanH


TanH

Description

Returns the hyperbolic tangent of an angle.

Syntax

FUNCTION TanH (VAL u: REAL): REAL;

Argument Notes

Argument Name Description
angle A real-value expression representing an angle in degrees

Example

VARIABLES r: REAL; ACTIONS r:=TanH(3.0);

Return Codes

Returns the hyperbolic tangent of an expression.

See Also

Tan


Tivoli Service Desk 6.0 Developer's Toolkit Script Language Reference

Return to Main Page

Copyright