HP Fortran Programmer's Reference (September 2007)
Intrinsic procedures
Intrinsic procedure specifications
Chapter 11 597
Arguments
A must be of type integer or real.
P must be of the same type and kind type parameter as A.
Result type/
type parameters
Same as A.
Result value
If P is not 0, the value of the result is A – INT(A/P) * P. If P=0, the result is
processor-dependent.
Specific forms
AMOD, BMOD, DMOD, HMOD, IMOD, JMOD, KMOD, QMOD.
MODULO(A, P)
Description
Modulo function.
Class
Elemental function.
Arguments
A must be of type integer or real.
P must be of the same type and kind type parameter as A.
Result type/
type parameters
Same as A.
Result value
Case 1 A is of type integer. If P is not 0, MODULO(A, P) has the value R such that A=
Q * P + R, where Q is an integer, the inequalities 0 <= R<P hold if P>0, and
P<R <= 0 hold if P<0. If P=0, the result is processor-dependent.