## C.2.2 Numeric Intrinsic Functions

Table C-3 lists the Compaq Fortran 77 numeric intrinsic functions.

### Table C-3 Numeric Intrinsic Functions

Function | No. of Arguments | Generic Name | Specific Name | Type of Argument | Type of Result
--- | --- | --- | --- | --- | ---
Absolute Value [1] | 1 | ABS | - | INTEGER*1[2] | INTEGER*1
|a| |  |  | IIABS | INTEGER*2 | INTEGER*2
|  |  | JIABS | INTEGER*4 | INTEGER*4
|  |  | KIABS[2] | INTEGER*8 | INTEGER*8
|  |  | ABS | REAL*4 | REAL*4
|  |  | DABS | REAL*8 | REAL*8
|  |  | QABS[3] | REAL*16 | REAL*16
|  |  | CABS | COMPLEX*8 | REAL*4
|  |  | CDABS | COMPLEX*16 | REAL*8
|  |  | ZABS | COMPLEX*16 | REAL*8
|  | IABS | - | INTEGER*1[2] | INTEGER*1
|  |  | IIABS | INTEGER*2 | INTEGER*2
|  |  | JIABS | INTEGER*4 | INTEGER*4
|  |  | KIABS[2] | INTEGER*8 | INTEGER*8
Complex from Two Arguments | - See Conversion to COMPLEX (CMPLX) and Conversion to DOUBLE COMPLEX (DCMPLX) -
Conversion to COMPLEX, | 1,2 | CMPLX | - | INTEGER*1[2] | COMPLEX*8
or | 1,2 |  | - | INTEGER*2 | COMPLEX*8
COMPLEX from | 1,2 |  | - | INTEGER*4 | COMPLEX*8
Two Arguments [4,5] | 1,2 |  | - | INTEGER*8[2] | COMPLEX*8
| 1,2 |  | - | REAL*4 | COMPLEX*8
| 1,2 |  | - | REAL*8 | COMPLEX*8
| 1,2 |  | - | REAL*16[3] | COMPLEX*8
| 1 |  | - | COMPLEX*8 | COMPLEX*8
| 1 |  | - | COMPLEX*16 | COMPLEX*8
Complex Conjugate | 1 | CONJG | CONJG | COMPLEX*8 | COMPLEX*8
(if a=(X,Y) CONJG(a)=(X,-Y)) |  |  | DCONJG | COMPLEX*16 | COMPLEX*16
Conversion to | 1 | DBLE | - | INTEGER*1[2] | REAL*8
DOUBLE PRECISION [6] |  |  | - | INTEGER*2 | REAL*8
|  |  | - | INTEGER*4 | REAL*8
|  |  | - | INTEGER*8[2] | REAL*8
|  |  | DBLE | REAL*4 | REAL*8
|  |  | - | REAL*8 | REAL*8
|  |  | DBLEQ[3] | REAL*16 | REAL*8
|  |  | - | COMPLEX*8 | REAL*8
|  |  | - | COMPLEX*16 | REAL*8
Conversion to | 1,2 | DCMPLX | - | INTEGER*1[2] | COMPLEX*16
DOUBLE COMPLEX, | 1,2 |  | - | INTEGER*2 | COMPLEX*16
or | 1,2 |  | - | INTEGER*4 | COMPLEX*16
DOUBLE COMPLEX | 1,2 |  | - | INTEGER*8[2] | COMPLEX*16
from Two Arguments [5] | 1,2 |  | - | REAL*4 | COMPLEX*16
| 1,2 |  | - | REAL*8 | COMPLEX*16
| 1,2 |  | - | REAL*16[3] | COMPLEX*16
| 1 |  | - | COMPLEX*8 | COMPLEX*16
| 1 |  | - | COMPLEX*16 | COMPLEX*16
DOUBLE PRECISION | 1 | DFLOAT | - | INTEGER*1[2] | REAL*8
Float[6] |  |  | DFLOTI | INTEGER*2 | REAL*8
(Integer-to-DOUBLE |  |  | DFLOTJ | INTEGER*4 | REAL*8
PRECISION conversion) |  |  | DFLOTK[2] | INTEGER*8 | REAL*8
Positive Difference [7] | 2 | DIM | - | INTEGER*1[2] | INTEGER*1
a1-(min(a1,a2)) |  |  | IIDIM | INTEGER*2 | INTEGER*2
|  |  | JIDIM | INTEGER*4 | INTEGER*4
|  |  | KIDIM[2] | INTEGER*8 | INTEGER*8
|  |  | DIM | REAL*4 | REAL*4
|  |  | DDIM | REAL*8 | REAL*8
|  |  | QDIM[3] | REAL*16 | REAL*16
|  | IDIM | - | INTEGER*1[2] | INTEGER*1
|  |  | IIDIM | INTEGER*2 | INTEGER*2
|  |  | JIDIM | INTEGER*4 | INTEGER*4
|  |  | KIDIM[2] | INTEGER*8 | INTEGER*8
DOUBLE PRECISION | 2 | - | DPROD | REAL*4 | REAL*8
product of REALs |  |  |  |  |
a1*a2 |  |  |  |  |
Float [4,6] | 1 | FLOAT | - | INTEGER*1[2] | REAL*4
(Integer-to-REAL |  |  | FLOATI | INTEGER*2 | REAL*4
conversion) |  |  | FLOATJ | INTEGER*4 | REAL*4
|  |  | FLOATK[2] | INTEGER*8 | REAL*4
Fix [4,6] | 1 | IFIX | IIFIX[8] | REAL*4 | INTEGER*2
(REAL-to-integer |  |  | JIFIX | REAL*4 | INTEGER*4
conversion) |  |  | KIFIX[2] | REAL*4 | INTEGER*8
Imaginary Part of Complex[4] | 1 | IMAG | AIMAG | COMPLEX*8 | REAL*4
|  |  | DIMAG | COMPLEX*16 | REAL*8
Truncation [4,9] | 1 | INT | - | INTEGER*1[2] | INTEGER*2
|a| |  |  | - | INTEGER*1[2] | INTEGER*4
|  |  | - | INTEGER*1 | INTEGER*8[2]
|  |  | - | INTEGER*2 | INTEGER*4
|  |  | - | INTEGER*2 | INTEGER*8[2]
|  |  | - | INTEGER*4 | INTEGER*4
|  |  | - | INTEGER*4 | INTEGER*8[2]
|  |  | - | INTEGER*8[2] | INTEGER*8
|  |  | IINT | REAL*4 | INTEGER*2
|  |  | JINT | REAL*4 | INTEGER*4
|  |  | KINT[2] | REAL*4 | INTEGER*8
|  |  | IIDINT | REAL*8 | INTEGER*2
|  |  | JIDINT | REAL*8 | INTEGER*4
|  |  | KIDINT[2] | REAL*8 | INTEGER*8
|  |  | IIQINT[3] | REAL*16 | INTEGER*2
|  |  | JIQINT[3] | REAL*16 | INTEGER*4
|  |  | KIQINT[3] | REAL*16 | INTEGER*8
|  |  | - | COMPLEX*8 | INTEGER*2
|  |  | - | COMPLEX*8 | INTEGER*4
|  |  | - | COMPLEX*8 | INTEGER*8[3]
|  |  | - | COMPLEX*16 | INTEGER*2
|  |  | - | COMPLEX*16 | INTEGER*4
|  |  | - | COMPLEX*16 | INTEGER*8[2]
|  | AINT | AINT | REAL*4 | REAL*4
|  |  | DINT | REAL*8 | REAL*8
|  |  | QINT[3] | REAL*16 | REAL*16
|  | IDINT | IIDINT | REAL*8 | INTEGER*2
|  |  | JIDINT | REAL*8 | INTEGER*4
|  |  | KIDINT[2] | REAL*8 | INTEGER*8
|  | IQINT[3] | IIQINT | REAL*16 | INTEGER*2
|  |  | JIQINT | REAL*16 | INTEGER*4
Maximum [4,10] | n | MAX | - | INTEGER*1[2] | INTEGER*1
max(a1,a2, ...an) |  |  | IMAX0 | INTEGER*2 | INTEGER*2
|  |  | JMAX0 | INTEGER*4 | INTEGER*4
|  |  | KMAX0[2] | INTEGER*8 | INTEGER*8
|  |  | AMAX1 | REAL*4 | REAL*4
|  |  | DMAX1 | REAL*8 | REAL*8
|  |  | QMAX1[3] | REAL*16 | REAL*16
|  | MAX0 | - | INTEGER*1[2] | INTEGER*1
|  |  | IMAX0 | INTEGER*2 | INTEGER*2
|  |  | JMAX0 | INTEGER*4 | INTEGER*4
|  |  | KMAX0[2] | INTEGER*8 | INTEGER*8
|  | MAX1 | IMAX1 | REAL*4 | INTEGER*2
|  |  | JMAX1 | REAL*4 | INTEGER*4
|  |  | KMAX1[2] | REAL*4 | INTEGER*8
|  | AMAX0 | - | INTEGER*1[2] | REAL*4
|  |  | AIMAX0 | INTEGER*2 | REAL*4
|  |  | AJMAX0 | INTEGER*4 | REAL*4
|  |  | AKMAX0[2] | INTEGER*8 | REAL*4
Minimum [4,10] | n | MIN | - | INTEGER*1[2] | INTEGER*1
min(a1,a2, ...an) |  |  | IMIN0 | INTEGER*2 | INTEGER*2
|  |  | JMIN0 | INTEGER*4 | INTEGER*4
|  |  | KMIN0[2] | INTEGER*8 | INTEGER*8
|  |  | AMIN1 | REAL*4 | REAL*4
|  |  | DMIN1 | REAL*8 | REAL*8
|  |  | QMIN1[3] | REAL*16 | REAL*16
|  | MIN0 | - | INTEGER*1[2] | INTEGER*1
|  |  | IMIN0 | INTEGER*2 | INTEGER*2
|  |  | JMIN0 | INTEGER*4 | INTEGER*4
|  |  | KMIN0[2] | INTEGER*8 | INTEGER*8
|  | MIN1 | IMIN1 | REAL*4 | INTEGER*2
|  |  | JMIN1 | REAL*4 | INTEGER*4
|  |  | KMIN1[2] | REAL*4 | INTEGER*8
|  | AMIN0 | - | INTEGER*1[2] | REAL*4
|  |  | AIMIN0 | INTEGER*2 | REAL*4
|  |  | AJMIN0 | INTEGER*4 | REAL*4
|  |  | AKMIN0[2] | INTEGER*8 | REAL*4
Remainder [9,11] | 2 | MOD | - | INTEGER*1[2] | INTEGER*1
a1-a2 * |a1/a2| |  |  | IMOD | INTEGER*2 | INTEGER*2
|  |  | JMOD | INTEGER*4 | INTEGER*4
|  |  | KMOD[2] | INTEGER*8 | INTEGER*8
|  |  | AMOD | REAL*4 | REAL*4
|  |  | DMOD | REAL*8 | REAL*8
|  |  | QMOD[3] | REAL*16 | REAL*16
Nearest Integer [4] | 1 | NINT | ININT | REAL*4 | INTEGER*2
|a + .5 * sign(a)| |  |  | JNINT | REAL*4 | INTEGER*4
|  |  | KNINT[2] | REAL*4 | INTEGER*8
|  |  | IIDNNT | REAL*8 | INTEGER*2
|  |  | JIDNNT | REAL*8 | INTEGER*4
|  |  | KIDNNT[2] | REAL*8 | INTEGER*8
|  |  | IIQNNT[3] | REAL*16 | INTEGER*2
|  |  | JIQNNT[3] | REAL*16 | INTEGER*4
|  |  | KIQNNT[3] | REAL*16 | INTEGER*8
|  | ANINT | ANINT | REAL*4 | REAL*4
|  |  | DNINT | REAL*8 | REAL*8
|  |  | QNINT[3] | REAL*16 | REAL*16
|  | IDNINT | IIDNNT | REAL*8 | INTEGER*2
|  |  | JIDNNT | REAL*8 | INTEGER*4
|  |  | KIDNNT[2] | REAL*8 | INTEGER*8
|  | IQNINT[3] | IIQNNT | REAL*16 | INTEGER*2
|  |  | JIQNNT | REAL*16 | INTEGER*4
Conversion to REAL*16 [3,6] | 1 | QEXT | - | INTEGER*1 | REAL*16
|  |  | - | INTEGER*2 | REAL*16
|  |  | - | INTEGER*4 | REAL*16
|  |  | - | INTEGER*8 | REAL*16
|  |  | QEXT | REAL*4 | REAL*16
|  |  | QEXTD | REAL*8 | REAL*16
|  |  | - | REAL*16 | REAL*16
|  |  | - | COMPLEX*8 | REAL*16
|  |  | - | COMPLEX*16 | REAL*16
REAL*16 Float [3] | 1 | QFLOAT | - | INTEGER*1 | REAL*16
(Integer-to-REAL*16 |  |  | - | INTEGER*2 | REAL*16
conversion) |  |  | - | INTEGER*4 | REAL*16
|  |  | - | INTEGER*8 | REAL*16
Conversion to REAL [4,6] | 1 | REAL | - | INTEGER*1[2] | REAL*4
|  |  | FLOATI | INTEGER*2 | REAL*4
|  |  | FLOATJ | INTEGER*4 | REAL*4
|  |  | FLOATK[2] | INTEGER*8 | REAL*4
|  |  | - | REAL*4 | REAL*4
|  |  | SNGL | REAL*8 | REAL*4
|  |  | SNGLQ[3] | REAL*16 | REAL*4
|  |  | - | COMPLEX*8 | REAL*4
|  |  | - | COMPLEX*16 | REAL*4
|  | SNGL | - | INTEGER*1[2] | REAL*4
|  |  | FLOATI | INTEGER*2 | REAL*4
|  |  | FLOATJ | INTEGER*4 | REAL*4
|  |  | FLOATK[2] | INTEGER*8 | REAL*4
|  |  | REAL | REAL*4 | REAL*4
|  |  | - | REAL*8 | REAL*4
|  |  | SNGLQ[3] | REAL*16 | REAL*4
Real Part of Complex | 1 | - | REAL | COMPLEX*8 | REAL*4
|  |  | DREAL | COMPLEX*16 | REAL*8
Transfer of Sign | 2 | SIGN | - | INTEGER*1[2] | INTEGER*1
|a1| if a2 >= 0 |  | IISIGN | INTEGER*2 | INTEGER*2
-|a1| if a2 < 0 |  |  | JISIGN | INTEGER*4 | INTEGER*4
|  |  | KISIGN[2] | INTEGER*8 | INTEGER*8
|  |  | SIGN | REAL*4 | REAL*4
|  |  | DSIGN | REAL*8 | REAL*8
|  |  | QSIGN[3] | REAL*16 | REAL*16
|  | ISIGN | - | INTEGER*1[2] | INTEGER*1
|  |  | IISIGN | INTEGER*2 | INTEGER*2
|  |  | JISIGN | INTEGER*4 | INTEGER*4
|  |  | KISIGN[2] | INTEGER*8 | INTEGER*8
Zero-Extend Functions[4] | 1 | ZEXT | IZEXT | LOGICAL*1 | INTEGER*2
|  |  | - | LOGICAL*2 | INTEGER*2
|  |  | - | INTEGER*1[2] | INTEGER*2
|  |  | - | INTEGER*2 | INTEGER*2
|  |  | JZEXT | LOGICAL*1 | INTEGER*4
|  |  | - | LOGICAL*2 | INTEGER*4
|  |  | - | LOGICAL*4 | INTEGER*4
|  |  | - | INTEGER*1[2] | INTEGER*4
|  |  | - | INTEGER*2 | INTEGER*4
|  |  | - | INTEGER*4 | INTEGER*4
|  |  | KZEXT[2] | LOGICAL*1 | INTEGER*8
|  |  | - | LOGICAL*2 | INTEGER*8
|  |  | - | LOGICAL*4 | INTEGER*8
|  |  | - | LOGICAL*8 | INTEGER*8
|  |  | - | INTEGER*1 | INTEGER*8
|  |  | - | INTEGER*2 | INTEGER*8
|  |  | - | INTEGER*4 | INTEGER*8
|  |  | - | INTEGER*8 | INTEGER*8
[1] The absolute value of a complex number, (X,Y), is the real value SQRT (X**2 + Y**2) [2] Alpha only [3] VMS, U*X [4] The setting of compiler option REAL_ SIZE affects the following functions: AIMAG, CMPLX, FLOAT, REAL, and SNGL. The setting of compiler option INTEGER_SIZE affects the following functions: IDINT, IDNINT, IFIX, INT, IQINT, IQNINT, MAX1, MIN1, NINT, and ZEXT. [5] When CMPLX and DCMPLX have only one argument, this argument is converted into the real part of a complex value, and zero is assigned to the imaginary part. (When there are two noncomplex arguments, a complex value is produced by converting the first argument into the real part of the value and converting the second argument into the imaginary part.) [6] Functions that cause conversion of one data type to another type have the same effect as the implied conversion in assignment statements. The following functions return the value of the argument without conversion: the function REAL with a real argument, the function DBLE with a double precision argument, the function INT with an integer argument, and the function QEXT with a REAL*16 argument. [7] DIM and IDIM return the first argument minus the minimum of the two arguments. [8] This function can also be spelled HFIX (to comply with the MIA standard). [9] |a| is defined as the largest integer whose magnitude does not exceed the magnitude of a and whose sign is the same as that of a. For example, |5.7| equals 5. and |-5.7| equals -5. [10] There must be at least two arguments. MAX, MAX0, MAX1, and AMAX0 return the maximum value within the argument list, while MIN, MIN0, MIN1, and AMIN0 return the minimum value within the argument list. [11] MOD returns the remainder when the first argument is divided by the second argument.

For More Information:

For details on names of compiler options used in this manual, see Section E.4.

Previous Page Next Page Table of Contents