Subject Re: [firebird-support] Problem Using MOD
Author Ivan Prenosil
Your declaration does not look good.
Either use
RETURNS INTEGER BY VALUE
or release buffer allocated by UDF by
RETURNS INTEGER FREE_IT

Ivan

----- Original Message -----
From: "Nairo Granados" <nairox@...>
> I'm using the function MOD in a stored procedure in Firebird 1.5 to
> get the remainder of a division but the operation get the wrong
> result.
>
> For Example
> A = MOD(2000, 19);
> The result is 105 instead of 5.
>
> I don't know why is this happen. Somebody could help me???
>
> This is the UDF function
>
> DECLARE EXTERNAL FUNCTION MOD
> INTEGER,
> INTEGER
> RETURNS INTEGER
> ENTRY_POINT 'IB_UDF_mod' MODULE_NAME 'ib_udf';