Clib Divide Method

The Clib Divide method performs integer division and returns a quotient and remainder.

Format

Clib.div(numerator, denominator)
Clib.ldiv(numerator, denominator)

Siebel eScript does not distinguish between integers and long integers, so clib.div and clib.ldiv are identical.

The following table describes the arguments for the Clib Divide method.

Argument Description

numerator

The number that this method divides.

denominator

The number by which this method divides the numerator.

Clib Divide Method describes the structure of the return value.

Element

Description

.quot

quotient

.rem

remainder

Example

The following example accepts two numbers as input from the user, divides the first number by the second number, and then displays the result:

var division = Clib.div(ToNumber(n), ToNumber(d));
   TheApplication().RaiseErrorText("The quotient is " + division.quot + ".\n\n" + 
"The remainder is " + division.rem + ".");

If run this example with the values of n=9 and d=4, then it produces the following result:

The quotient is 2.
The remainder is 1.