mod(3I)
MOD, AMOD, DMOD, QMOD, IMOD, JMOD, KMOD - Computes remainder
As shipped in IRIX 6.5.7. Added in IRIX 6.5.5.
NAME MOD, AMOD, DMOD, QMOD, IMOD, JMOD, KMOD - Computes remainder SYNOPSIS MOD ([A=]a,[P=]p) AMOD ([A=]a,[P=]p) DMOD ([A=]a,[P=]p) QMOD ([A=]a,[P=]p) IMOD ([A=]a,[P=]p) JMOD ([A=]a,[P=]p) KMOD ([A=]a,[P=]p) IMPLEMENTATION UNICOS, UNICOS/mk, IRIX systems CF90, MIPSpro 7 Fortran 90, MIPSpro Fortran 77 STANDARDS Fortran Fortran extensions: IMOD, JMOD, KMOD, QMOD DESCRIPTION These intrinsic functions compute the remainder of a / p. MOD is the generic function name; the others are specifics. These are elemental intrinsic functions. They accept the following arguments: a Must be of type integer or real. p Must be of the same type and kind type as a. The result is undefined if p is zero. These functions evaluate y = a - p * INT(a/p). NOTES The MOD, AMOD, and DMOD intrinsic function names can be passed as arguments; the others cannot. RETURN VALUES MOD returns the integer remainder of its integer arguments. AMOD returns the single-precision real remainder of its single-precision real arguments. DMOD returns the double-precision real remainder of its double-precision real arguments. QMOD returns the quad-precision real remainder of its quad-precision real arguments. IMOD returns the integer (KIND=2) remainder of its integer (KIND=2) arguments. JMOD returns the integer (KIND=4) remainder of its integer (KIND=4) arguments. KMOD returns the integer (KIND=8) remainder of its integer (KIND=8) arguments. The data type and kind type for single-precision, double-precision, and quad-precision values differ depending on your platform. For platform-specific information, see the TERMINOLOGY section of the INTRO_INTRIN(3I) man page. EXAMPLES The following examples show the results of calling MOD with all possible combinations of positive and negative integers: MOD(7,4) = 3 MOD(-7,4) = -3 MOD(7,-4) = 3 MOD(-7,-4) = -3 SEE ALSO Intrinsic Procedures Reference Manual for the printed version of this man page.