cmplx
- Date:
10-12-2011
NAME
CMPLX, DCMPLX - Convert to type complex
SYNOPSIS
CMPLX ([X=]x [,[Y=]y] [,[KIND=]kind])
DCMPLX ([X=]x [,[Y=]y])
IMPLEMENTATION
Cray Linux Environment (CLE)
STANDARDS
Fortran
Fortran extension: DCMPLX
DESCRIPTION
CMPLX is a generic function name; DCMPLX is specific. These are elemental intrinsic functions that convert x and (if specified) y into type complex. Their arguments are as follows:
- x
The real part of complex number. Must be type integer, Boolean, real, complex, or double precision. If x is of type complex, argument y cannot be specified.
See the RETURN VALUES section for more information on input data types and return values.
- y
The imaginary part of a number. Must be of the same type and kind type as x. If unspecified, zero is assumed.
- kind
A scalar integer initialization expression. The kind type assigned to the result. Must be a valid kind type for type complex on your platform. Kind types accepted differ from platform to platform, see Cray Fortran Reference Manual for information on valid types and kind types allowed.
Type conversion routines assign the appropriate type to Boolean arguments without shifting or manipulating the bit patterns they represent.
The following cases represent the evaluation of CMPLX when using both arguments:
CMPLX(I,J) yields FLOAT(I)+i*FLOAT(J).
CMPLX(x,y) yields the complex value x+i*y.
The following cases represent the evaluation of CMPLX when using the first argument:
CMPLX(X) yields X+i*0.
CMPLX(I) yields FLOAT(I)+i*0.
If C is complex, CMPLX(C) yields C.
NOTES
The names of these intrinsics cannot be passed as arguments.
RETURN VALUES
If the kind argument is specified, the kind type of the result is the same as the kind argument.
If the kind argument is not specified, the following return values are obtained:
CMPLX returns a complex value.
DCMPLX returns a double-complex value.