Description: | Converts a value to real type. | ||
Class: | Elemental function; Generic | ||
Arguments: | A | Must be of type integer, real, or complex. | |
KIND (opt) | Must be a scalar integer initialization expression. | ||
Results: | The result
is real type. If KIND is present, the kind parameter is that
specified by KIND. If KIND is not present, see the following table
for the kind parameter.
Functions that cause conversion of one data type to another type have the same affect as the implied conversion in assignment statements. If A is integer or real, the result is equal to an approximation of A. If A is complex, the result is equal to an approximation of the real part of A. |
Specific Name[1] | Argument Type | Result Type |
---|---|---|
INTEGER(1) | REAL(4) | |
FLOATI | INTEGER(2) | REAL(4) |
FLOAT[2, 3] | INTEGER(4) | REAL(4) |
REAL[2] | INTEGER(4) | REAL(4) |
FLOATK | INTEGER(8) | REAL(4) |
REAL(4) | REAL(4) | |
SNGL[2, 4] | REAL(8) | REAL(4) |
SNGLQ | REAL(16) | REAL(4) |
COMPLEX(4) | REAL(4) | |
COMPLEX(8) | REAL(8) | |
[1] These specific functions cannot be passed as actual
arguments.
|
Examples
REAL (-4) has the value -4.0.
REAL (Y) has the same kind parameter and value as the real part of complex variable Y.