Intel® Fortran supports the following little endian floating-point formats in memory:
Floating-point size |
Format in memory |
REAL(KIND=4) |
IEEE* S_floating |
REAL(KIND=8) |
IEEE T_floating |
REAL(KIND=16 |
IEEE X_floating |
If your program needs to read or write unformatted data files containing a floating-point format that differs from the format in memory for that data size, you can request that the unformatted data be converted.
Data storage in different computers uses a convention of either little endian or big endian storage. The storage convention generally applies to numeric values that span multiple bytes, as follows:
Little endian storage occurs when:
The least significant bit (LSB) value is in the byte with the lowest address.
The most significant bit (MSB) value is in the byte with the highest address.
The address of the numeric value is the byte containing the LSB. Subsequent bytes with higher addresses contain more significant bits.
Big endian storage occurs when:
The least significant bit (LSB) value is in the byte with the highest address.
The most significant bit (MSB) value is in the byte with the lowest address.
The address of the numeric value is the byte containing the MSB. Subsequent bytes with higher addresses contain less significant bits.
The following figure shows the difference between the two byte-ordering schemes:
Little and Big Endian Storage of an INTEGER Value
Moving unformatted data files between big endian and little endian computers requires that the data be converted.
Intel Fortran provides the capability for programs to read and write unformatted data (originally written using unformatted I/O statements) in several nonnative floating-point formats and in big endian INTEGER or floating-point format. Supported nonnative floating-point formats include VAX* little endian floating-point formats supported by VAX FORTRAN, standard IEEE big endian floating-point format found on most Sun Microsystems* systems and IBM RISC* System/6000 systems, IBM floating-point formats (associated with the IBM's System/370 and similar systems), and CRAY* floating-point formats.
Converting unformatted data instead of formatted data is generally faster and is less likely to lose precision of floating-point numbers.
The native memory format includes little endian integers and little endian IEEE floating-point formats, S_floating for REAL(KIND=4) and COMPLEX(KIND=4) declarations, T_floating for REAL(KIND=8) and COMPLEX(KIND=8) declarations, and IEEE X_floating for REAL(KIND=16) and COMPLEX(KIND=16) declarations.
The keywords for supported nonnative unformatted file formats and their data types are listed in the following table:
Nonnative Numeric Format Keywords and Supported Data Types
Keyword |
Description |
BIG_ENDIAN |
Big endian integer data of the appropriate INTEGER size (one, two, four, or eight bytes) and big endian IEEE floating-point formats for REAL and COMPLEX single- and double- and extended-precision numbers. INTEGER (KIND=1) or INTEGER*1 data is the same for little endian and big endian. |
CRAY |
Big endian integer data of the appropriate INTEGER size (one, two, four, or eight bytes) and big endian CRAY proprietary floating-point format for REAL and COMPLEX single- and double-precision numbers. |
FDX |
Native little endian integers of the appropriate INTEGER size (one, two, four, or eight bytes) and the following little endian proprietary floating-point formats:
|
FGX |
Native little endian integers of the appropriate INTEGER size (one, two, four, or eight bytes) and the following little endian proprietary floating-point formats:
|
IBM |
Big endian integer data of the appropriate INTEGER size (one, two, or four bytes) and big endian IBM proprietary (System\370 and similar) floating-point format for REAL and COMPLEX single- and double-precision numbers. |
LITTLE_ENDIAN |
Native little endian integers of the appropriate INTEGER size (one, two, four, or eight bytes) and the following native little endian IEEE floating-point formats:
|
NATIVE |
No conversion occurs between memory and disk. This is the default for unformatted files. |
VAXD |
Native little endian integers of the appropriate INTEGER size (one, two, four, or eight bytes) and the following little endian VAX proprietary floating-point formats:
|
VAXG |
Native little endian integers of the appropriate INTEGER size (one, two, four, or eight bytes) and the following little endian VAX proprietary floating-point formats:
|
When reading a nonnative format, the nonnative format on disk is converted to native format in memory. If a converted nonnative value is outside the range of the native data type, a run-time message is displayed.
See also:
Environment Variable F_UFMTENDIAN Method