9.199. MOD

9.199 MOD — Remainder function

Description:

MOD(A,P) computes the remainder of the division of A by P.

Standard:

Fortran 77 and later, has overloads that are GNU extensions

Class:

Elemental function

Syntax:

RESULT = MOD(A, P)

Arguments:
A Shall be a scalar of type INTEGER or REAL.
P Shall be a scalar of the same type and kind as A and not equal to zero.
Return value:

The return value is the result of A - (INT(A/P) * P). The type and kind of the return value is the same as that of the arguments. The