Platform | x64, Win32, .NET |
Purpose |
To convert a number or a pair of numbers to complex type. |
Class |
Elemental function. |
Syntax |
COMPLEX FUNCTION CMPLX(X [,Y,KIND]);REAL X; INTEGER KIND |
Description |
KIND an optional scalar value. If it is omitted the return type is the default complex type. If KIND is present it specifies the kind type of the return value. If X is real or integer it represents the real part of the complex result. In this case if Y is absent its default value is zero. Y is optional. It is either real or integer (not complex) and represents the imaginary part of the complex result. |
Example |
CMPLX(-4) gives the value (-4.0, 0.0). |