The possibility of multiple integer types is not addressed by the Fortran Standard. The compiler copes with their existence by treating a specific INTEGER-to-INTEGER function name (IABS, and so forth) as a special sort of generic. The argument type is used to select the appropriate runtime routine name, which is not accessible to the programmer.
VMS Fortran takes a similar approach, but makes the specific names available.
Table 3–12 VMS Integer Functions
Specific Names |
Function |
Argument Type |
Result Type |
---|---|---|---|
IIABS JIABS KIABS |
Absolute value |
INTEGER*2 INTEGER*4 INTEGER*8 |
INTEGER*2 INTEGER*4 INTEGER*8 |
IMAX0 JMAX0 |
Maximum |
INTEGER*2 INTEGER*4 |
INTEGER*2 INTEGER*4 |
IMIN0 JMIN0 |
Minimum |
INTEGER*2 INTEGER*4 |
INTEGER*2 INTEGER*4 |
IIDIM JIDIM KIDIM |
Positive difference |
INTEGER*2 INTEGER*4 INTEGER*8 |
INTEGER*2 INTEGER*4 INTEGER*8 |
IMOD JMOD |
Remainder of a1/a2 |
INTEGER*2 INTEGER*4 |
INTEGER*2 INTEGER*4 |
IISIGN JISIGN KISIGN |
Transfer of sign, |a1|* sign(a2) |
INTEGER*2 INTEGER*4 INTEGER*8 |
INTEGER*2 INTEGER*4 INTEGER*8 |