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.

Functions and Subroutines<br />

12.3.4 Type Conversion: Conversion to double precision<br />

Name:<br />

Usage:<br />

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

DREAL D ←DREAL(Z) †<br />

DFLOAT D ←DFLOAT(I) †<br />

Notes:<br />

For X of type COMPLEX, DBLE(X) is the double precision representation of the real<br />

part of X. For X of type COMPLEX*16, DBLE(X) is the real part of X.<br />

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

12.3.5 Type Conversion: Conversion to complex<br />

Name:<br />

CMPLX (generic)<br />

Usage:<br />

C ←CMPLX(I), C ←CMPLX(I,I), C ←CMPLX(R), C ←CMPLX(R,R), C<br />

←CMPLX(D), C ←CMPLX(D,D), C ←CMPLX(C), C ←CMPLX(Z) †<br />

Notes: If X is of type COMPLEX, then CMPLX(X) is X. If X is of type COMPLEX*16,<br />

then CMPLX(X) is a complex number whose real part is REAL(real part of X) and<br />

imaginary part is REAL(imaginary part of X).<br />

If X is not of type COMPLEX, then CMPLX(X) is the complex number whose real<br />

part is REAL(X) and imaginary part is REAL(0). CMPLX(X,Y) is the complex<br />

number whose real part is REAL(X) and whose imaginary part is REAL(Y) for X,Y<br />

not of type COMPLEX.<br />

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

12.3.6 Type Conversion: Conversion to double complex<br />

Name:<br />

Usage:<br />

DCMPLX (generic) † Z ←DCMPLX(I), Z ←DCMPLX(I,I), Z ←DCMPLX(R), Z ←DCMPLX(R,R), Z<br />

←DCMPLX(D), Z ←DCMPLX(D,D), Z ←DCMPLX(C), Z ←DCMPLX(Z)<br />

Notes:<br />

If X is of type COMPLEX*16, then DCMPLX(X) is X. If X is of type COMPLEX,<br />

then DCMPLX(X) is a COMPLEX*16 number whose real part is DBLE(real part of<br />

X) and imaginary part is DBLE(imaginary part of X).<br />

If X is not of type COMPLEX*16, then DCMPLX(X) is the COMPLEX*16 number<br />

whose real part is DBLE(X) and imaginary part is DBLE(0). DCMPLX(X,Y) is the<br />

COMPLEX*16 number whose real part is DBLE(X) and whose imaginary part is<br />

DBLE(Y) for X,Y not of type COMPLEX.<br />

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

Intrinsic Functions 249

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

Saved successfully!

Ooh no, something went wrong!