XL Fortran for AIX 8.1

Language Reference


MOD(A, P)

Remainder function.

A
must be of type integer or real.

P

must be of the same type and kind type parameter as A.

+-------------------------------IBM Extension--------------------------------+

The kind type parameters can be different if the compiler option -qport=mod is specified.

+----------------------------End of IBM Extension----------------------------+

Class

Elemental function

Result Type and Attributes

Same as A.

Result Value

Examples

MOD (3.0, 2.0) has the value 1.0.
MOD (8, 5) has the value 3.
MOD (-8, 5) has the value -3.
MOD (8, -5) has the value 3.
MOD (-8, -5) has the value -3.


Specific Name Argument Type Result Type Pass As Arg?
MOD any integer same as argument yes
AMOD default real default real yes
DMOD double precision real double precision real yes
QMOD REAL(16) REAL(16) yes

Notes:

  1. IBM Extension: the ability to pass the name as an argument.

Related Information

For information on alternative behavior for MOD when porting programs to XL Fortran, see the -qport compiler option in the User's Guide.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]