24.11.2014 Views

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Language</strong> <strong>Reference</strong><br />

12.3.2 Type Conversion: Conversion to integer<br />

Definition:<br />

Name:<br />

int(a)<br />

Usage:<br />

INT (generic) I ←INT(I), I ←INT(R), I ←INT(D), I ←INT(C), I ←INT(Z) †<br />

INT<br />

I ←INT(R)<br />

HFIX I2 ←HFIX(R) †<br />

IFIX<br />

IDINT<br />

Notes:<br />

I ←IFIX(R)<br />

I ←IDINT(D)<br />

The value of int(X) is X if X is of type INTEGER. If X is of type REAL or DOUBLE<br />

PRECISION, then int(X) is 0 if |X| 1.<br />

If X is of type COMPLEX or COMPLEX*16, int(X) is int(real part of X).<br />

† is an extension to <strong>FORTRAN</strong> <strong>77</strong>.<br />

12.3.3 Type Conversion: Conversion to real<br />

Name:<br />

Usage:<br />

REAL (generic) R ←REAL(I), R ←REAL(R), R ←REAL(D), R ←REAL(C), R ←REAL(Z) †<br />

REAL<br />

FLOAT<br />

SNGL<br />

R ←REAL(I)<br />

R ←FLOAT(I)<br />

R ←SNGL(D)<br />

Notes: For X of type COMPLEX, REAL(X) is the real part of X. For X of type<br />

COMPLEX*16, REAL(X) is the single precision representation of the real part of X.<br />

† is an extension to <strong>FORTRAN</strong> <strong>77</strong>.<br />

248 Intrinsic Functions

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!