Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

MOD - Modulo

The MOD function returns an integer value that is argument-1 modulo argument-2.The type of this function is integer.

Format


FUNCTION MOD (argument-1 argument-2)


Arguments

  1. argument-1 and argument-2 must be integers.

  2. The value v of argument-1 must lie in the range -1031 < v < 1031

    If the value of argument-1 is outside this range, the function value can be calculated but is not guaranteed to be correct.

  3. The value of argument-2 must not be 0.

Returned values

  1. The returned value is argument-1 modulo argument-2. The returned value is defined as:
    argument-1 - (argument-2 * FUNCTION INTEGER (argument-1 / argument-2))

  2. The error default value is -9’999’999’999’999’999’999’999’999’999’999.


See also:
        REM

Example 9-29

argument-1

argument-2

Returned value

11
-11
11
-11

5
5
-5
-5

1
4
-4
-1