modrem

Declaration

Integer function modrem(Integer X, integer Y)

Description

modrem returns the remainder portion of i mod p where Y != 0.

Example Stored Procedure

CREATE PROCEDURE test_modrem (X INTEGER, Y INTEGER)

RETURNS (result INTEGER) AS

BEGIN

result = modrem(X,Y);

END!!

WISQL - calling the example stored procedure

execute procedure test_modrem(10,-3);

RESULT

===========

1

execute procedure test_modrem(-10,-3);

RESULT

===========

-1

execute procedure test_modrem(-10,3);

RESULT

===========

-1

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

execute procedure test_modrem(-10,0);

RESULT

===========

-999999