FTYPE(3F) COMMAND REFERENCE FTYPE(3F)
NAME
ftype, int, ifix, idint, real, float, sngl, dble, cmplx,
dcmplx, ichar, char - explicit FORTRAN type conversion
SYNOPSIS
integer i, j
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 = ifix(r)
i = idint(dp)
r = real(i)
r = real(dp)
r = real(cx)
r = real(dcx)
r = float(i)
r = sngl(dp)
dp = dble(i)
dp = dble(r)
dp = dble(cx)
dp = dble(dcx)
cx = cmplx(i)
cx = cmplx(i, j)
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(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
Printed 3/13/89 1
FTYPE(3F) COMMAND REFERENCE FTYPE(3F)
another.
Int converts to integer from 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 (for example, truncation).
For complex types, the above rule is applied to the real
part. Ifix and idint convert only real and double precision
arguments respectively.
Real converts to real from an integer, double precision,
complex, or double complex argument. If the argument is
double precision or double complex, as much precision 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 respectively.
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.
Cmplx converts its integer, real, double precision, or
double complex argument(s) to complex form.
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 a 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.
Ichar converts from a character to an integer depending on
the character's position in the collating sequence.
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:
ichar(char(i)) = i for 0 <= i < n
char(ichar(ch)) = ch for any representable character ch.
Printed 3/13/89 2
FTYPE(3F) COMMAND REFERENCE FTYPE(3F)
SEE ALSO
intro(3f).
Printed 3/13/89 3
%%index%%
na:288,168;
sy:456,5281;
de:5737,184;6281,3596;
se:10237,159;
%%index%%000000000095