TRANSFER — Transfer bit patterns#
-
TRANSFER(SOURCE, MOLD, SIZE)#
Interprets the bitwise representation of
SOURCE
in memory as if it is the representation of a variable or array of the same type and type parameters asMOLD
.- Parameters:
SOURCE – Shall be a scalar or an array of any type.
MOLD – Shall be a scalar or an array of any type.
SIZE – (Optional) shall be a scalar of type
INTEGER
.
- Returns:
The result has the same type as
MOLD
, with the bit level representation ofSOURCE
. IfSIZE
is present, the result is a one-dimensional array of lengthSIZE
. IfSIZE
is absent butMOLD
is an array (of any size or shape), the result is a one- dimensional array of the minimum length needed to contain the entirety of the bitwise representation ofSOURCE
. IfSIZE
is absent andMOLD
is a scalar, the result is a scalar.
- Standard:
Fortran 90 and later
- Class:
Transformational function
- Syntax:
RESULT = TRANSFER(SOURCE, MOLD[, SIZE])
- Example:
PROGRAM test_transfer integer :: x = 2143289344 print *, transfer(x, 1.0) ! prints "NaN" on i686 END PROGRAM