modquot

Declaration

Integer function modquot (Integer X, integer Y)

Description

modquot returns the quotient portion of X mod Y where Y != 0.

Example Stored Procedure

CREATE PROCEDURE test_modquot (X INTEGER, Y INTEGER)

RETURNS (result INTEGER) AS

BEGIN

result = modquot(X,Y);

END!!

WISQL - calling the example stored procedure

execute procedure test_modquot(10,3);

RESULT

===========

3

execute procedure test_modquot(10,2);

RESULT

===========

5

execute procedure test_modquot(-10,2);

RESULT

===========

-5

execute procedure test_modquot(10,-2);

RESULT

===========

-5

execute procedure test_modquot(0,-2);

RESULT

===========

0

Error Results - restrictions on Y are : Y != 0

execute procedure test_modquot(-10,0);

RESULT

===========

-999999