modulo(3I)

MODULO - Modulo function

As shipped in IRIX 6.5. First release of IRIX 6.5.

NAME
     MODULO - Modulo function

SYNOPSIS
     MODULO ([A=]a, [P=]p)

IMPLEMENTATION
     UNICOS, UNICOS/mk, and IRIX systems

STANDARDS
     Fortran 90

DESCRIPTION
     The MODULO function accepts the following arguments:

     a    Must be of type integer or real

     p    Must be of the same type and kind type parameter as a

     MODULO is an elemental function.  The name of this intrinsic cannot be
     passed as an argument.

RETURN VALUES
     The result type and type parameter are the same as a, which can be
     integer or real.

     When a is of type integer, if P = 0, MODULO (a, p) has the value r
     such that A = Q x P + R, where q is an integer.  The inequality
     0 <= r < p holds if p > 0, and p < r <= 0 holds if p < 0.

     If P = 0, the result is machine-specific.  The result is not a
     meaningful number (a NAN) when that value is available.  Otherwise the
     result is 0.

     When a is of type real, if P = 0, the value of the result is A - FLOOR
     (A / P) * P.  If P = 0, the result is machine-specific.

EXAMPLES
     MODULO(8, 5) has the value 3.  MODULO(-8, 5) has the value 2.
     MODULO(8, -5) has the value -2.  MODULO(-8, -5) has the value -3.

SEE ALSO
     Intrinsic Procedures Reference Manual, publication SR-2138, for the
     printed version of this man page.