The BYTEORDER procedure converts integers between host and network byte ordering or floating-point values between the native format and XDR (IEEE) format. This routine can also be used to swap the order of bytes within both short and long integers. If the type of byte swapping is not specified via one of the keywords below, bytes within short integers are swapped (even and odd bytes are interchanged).
The size of the parameter, in bytes, must be evenly divisible by two for short integer swaps, and by four for long integer swaps. BYTEORDER operates on both scalars and arrays. The parameter must be a variable, not an expression or constant, and may not contain strings. The contents of Variable are overwritten by the result.
Network byte ordering is " big endian". That is, multiple byte integers are stored in memory beginning with the most significant byte.
Set this keyword to convert native (IEEE) double-precision floating-point format to VAX D float format. See Note On IEEE to VAX Format Conversion .
Set this keyword to convert native double-precision floating-point format to XDR (IEEE) format.
Set this keyword to convert native (IEEE) single-precision floating-point format to VAX F float format. See Note On IEEE to VAX Format Conversion .
Set this keyword to convert native single-precision floating-point format to XDR (IEEE) format.
Set this keyword to perform a longword swap. Swap the order of the bytes within each longword. For example, the four bytes within a longword are changed from (B 0 , B 1 , B 2 , B 3 ), to (B 3 , B 2 , B 1 , B 0 ).
Set this keyword to perform a short word swap. Swap the bytes within short integers. The even and odd numbered bytes are interchanged. This is the default action, if no other keyword is set.
If this keyword is set, the BYTEORDER request will only be performed if the platform running IDL uses "big endian" byte ordering. On little endian machines, the BYTEORDER request quietly returns without doing anything. Note that this keyword does not refer to the byte ordering of the input data, but to the computer hardware.
If this keyword is set, the BYTEORDER request will only be performed if the platform running IDL uses "little endian" byte ordering. On little endian machines, the BYTEORDER request quietly returns without doing anything. Note that this keyword does not refer to the byte ordering of the input data, but to the computer hardware.
Set this keyword to convert VAX D float format to native (IEEE) double-precision floating-point format. See Note On IEEE to VAX Format Conversion .
NOTE: If you have VAX G float format data, see the VMS-Only Keywords .
Set this keyword to convert VAX F float format to native (IEEE) single-precision floating-point format. See Note On IEEE to VAX Format Conversion .
NOTE: If you have VAX G float format data, see the VMS-Only Keywords .
Set this keyword to convert native (IEEE) double-precision floating-point format to VAX G float format. Note that IDL does not support the VAX G float format via any other mechanism. See Note On IEEE to VAX Format Conversion .
Set this keyword to convert VAX G float format to native (IEEE) double-precision floating-point format. Note that IDL does not support the VAX G float format via any other mechanism. See Note On IEEE to VAX Format Conversion .
Translation of floating-point values from the IDL's native (IEEE) format to the VAX formats and back (IEEE to VAX to IEEE) is not a completely reversable operation, and should be avoided when possible. There are many cases where the recovered values will differ from the original, including:
Research Systems recommends using IEEE/VAX conversions only to read existing VAX format data, and strongly recommends that all new files be created using the IEEE format.