ftype(3F) ftype(3F)
NAME
int, ifix, idint, real, float, sngl, dble, dreal, cmplx,
dcmplx, ichar, char, jint, iint, iifix, jifix, jidint,
iidint, floatj, floati, dflotj, dfloti - explicit Fortran
type conversion
SYNOPSIS
integer i, j
integer*2 i2, j2
real r, s
double precision dp, dq
complex cx
double complex dcx
character*1 ch
i = int(r)
i = int(dp)
i = int(cx)
i = int(dcx)
i = jint(r)
i = ifix(r)
i = jifix(r)
i = idint(dp)
i = jidint(dp)
i2 = int(r)
i2 = iint(r)
i2 = iifix(r)
i2 = iidint(dp)
r = real(i)
r = real(dp)
r = real(cx)
r = real(dcx)
r = float(i)
r = floatj(i)
r = floati(i2)
r = sngl(dp)
dp = dble(i)
dp = dble(r)
dp = dble(cx)
dp = dble(dcx)
dp = dreal(dcx)
dp = dfloat(i)
dp = dfloat(i2)
dp = dflotj(i)
dp = dfloti(i2)
cx = cmplx(i)
cx = cmplx(i, j)
Page 1 CX/UX Hf77 Fortran Reference Manual
ftype(3F) ftype(3F)
cx = cmplx(i2)
cx = cmplx(i2, j2)
cx = cmplx(r)
cx = cmplx(r, s)
cx = cmplx(dp)
cx = cmplx(dp, dq)
cx = cmplx(dcx)
dcx = dcmplx(i)
dcx = dcmplx(i, j)
dcx = dcmplx(i2)
dcx = dcmplx(i2, j2)
dcx = dcmplx(r)
dcx = dcmplx(r, s)
dcx = dcmplx(dp)
dcx = dcmplx(dp, dq)
dcx = dcmplx(cx)
i = ichar(ch)
ch = char(i)
DESCRIPTION
These functions perform conversion from one data type to
another.
The function int converts to integer form its real, double
precision, complex, or double complex argument. If the
argument is real or double precision, int returns the
integer whose magnitude is the largest integer that does not
exceed the magnitude of the argument and whose sign is the
same as the sign of the argument (i.e., truncation). For
complex types, the above rule is applied to the real part.
ifix and idint convert only real and double precision argu-
ments, respectively.
The function real converts to real form an integer, double
precision, complex, or double complex argument. If the
argument is double precision or double complex, as much pre-
cision is kept as is possible. If the argument is one of the
complex types, the real part is returned. float and sngl
convert only integer and double precision arguments, respec-
tively.
The function dble converts any integer, real, complex, or
double complex argument to double precision form. If the
argument is of a complex type, the real part is returned.
The function dreal returns the double precision real part of
its double complex argument.
The function cmplx converts its integer, real, double preci-
sion, or double complex argument(s) to complex form.
Page 2 CX/UX Hf77 Fortran Reference Manual
ftype(3F) ftype(3F)
The function dcmplx converts to double complex form its
integer, real, double precision, or complex argument(s).
Either one or two arguments may be supplied to cmplx and
dcmplx. If there is only one argument, it is taken as the
real part of the complex type and an imaginary part of zero
is supplied. If two arguments are supplied, the first is
taken as the real part and the second as the imaginary part.
The functions jint, jifix, jidint, iint, iifix, iidint,
floatj, floati, dflotj and dfloti have been included to pro-
vide compatibility with other vendors and are not recom-
mended for general use.
The function ichar converts from a character to an integer
depending on the character's position in the collating
sequence.
The function char returns the character in the ith position
in the processor collating sequence where i is the supplied
argument.
For a processor capable of representing n characters,
i .EQ. ichar(char(i)) for 0 < i < n, and
ch .EQ. char(ichar(ch)) for any representable charac-
ter ch.
Page 3 CX/UX Hf77 Fortran Reference Manual