HELPLIB.HLB  —  FORTRAN  Intrinsic Procedures, MODULO
  MODULO (number-a, number-b)

  Class:  Elemental function - Generic

  Returns the modulo of the arguments.  The arguments can be integer
  or real type.  They must both be the same type and kind type
  parameter.

  The result is the same type as the arguments.

  If "number-a" is of type integer and "number-b" is not equal to
  zero, the value of the result is "number-a" -
  FLOOR(REAL("number-a")/REAL("number-b")) * "number-b".  If
  "number-a" is of type real and "number-b" is not equal to zero, the
  value of the result is "number-a" - FLOOR("number-a"/"number-b").
  If "number-b" is equal to zero, the result is undefined.

  Examples:

  MODULO (7, 3) has the value 1.

  MODULO (9, -6) has the value -3.

  MODULO (-9, 6) has the value 3.
Close Help