www.delorie.com/gnu/docs/gcc/g77_119.html   search  
 
Buy the book!


Using and Porting GNU Fortran

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.11.9.44 Complex Intrinsic

 
Complex(Real, Imag)

Complex: COMPLEX function, the exact type being the result of cross-promoting the types of all the arguments.

Real: INTEGER or REAL; scalar; INTENT(IN).

Imag: INTEGER or REAL; scalar; INTENT(IN).

Intrinsic groups: gnu.

Description:

Returns a COMPLEX value that has `Real' and `Imag' as its real and imaginary parts, respectively.

If Real and Imag are the same type, and that type is not INTEGER, no data conversion is performed, and the type of the resulting value has the same kind value as the types of Real and Imag.

If Real and Imag are not the same type, the usual type-promotion rules are applied to both, converting either or both to the appropriate REAL type. The type of the resulting value has the same kind value as the type to which both Real and Imag were converted, in this case.

If Real and Imag are both INTEGER, they are both converted to REAL(KIND=1), and the result of the COMPLEX() invocation is type COMPLEX(KIND=1).

Note: The way to do this in standard Fortran 90 is too hairy to describe here, but it is important to note that `CMPLX(D1,D2)' returns a COMPLEX(KIND=1) result even if `D1' and `D2' are type REAL(KIND=2). Hence the availability of COMPLEX() in GNU Fortran.


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003