TRANSFER
— Transfer bit patternsThis is approximately equivalent to the C concept of casting one type to another.
RESULT = TRANSFER(SOURCE, MOLD[, SIZE])
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 . |
If the bitwise representation of the result is longer than that of SOURCE, then the leading bits of the result correspond to those of SOURCE and any trailing bits are filled arbitrarily.
When the resulting bit representation does not correspond to a valid representation of a variable of the same type as MOLD, the results are undefined, and subsequent operations on the result cannot be guaranteed to produce sensible behavior. For example, it is possible to create LOGICAL
variables for which VAR and .NOT.
VAR both appear to be true.
PROGRAM test_transfer integer :: x = 2143289344 print *, transfer(x, 1.0) ! prints "NaN" on i686 END PROGRAM
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-5.4.0/gfortran/TRANSFER.html