idlastro / Miscellaneous (Non-Astronomy) Procedures: HOST_TO_IEEE

[Source code]

NAME
HOST_TO_IEEE
PURPOSE
Translate an IDL variable from host to IEEE representation 
EXPLANATION
The variable is converted from the format used by the host architecture
into IEEE-754 representation ("big endian" as used, e.g., in FITS data ).
Duplicates most of the functionality of the SWAP_ENDIAN_INPLACE procedure
with the addition of the IDLTYPE keyword.
CALLING SEQUENCE
HOST_TO_IEEE, data, [ IDLTYPE = ]
INPUT-OUTPUT PARAMETERS
data - any IDL variable, scalar or vector.   It will be modified by
        HOST_TO_IEEE to convert from host to IEEE representation.  Byte 
        and string variables are returned by HOST_TO_IEEE unchanged
OPTIONAL KEYWORD INPUTS
IDLTYPE - scalar integer (1-15) specifying the IDL datatype according
          to the code given by the SIZE function.      This keyword
          will usually be used when supplying a byte array that needs
          to be interpreted as another data type (e.g. FLOAT).
EXAMPLE
Suppose FITARR is a 2880 element byte array to be converted to a FITS
record and interpreted a FLOAT data.
  IDL> host_to_ieee, FITARR, IDLTYPE = 4
METHOD
The BYTEORDER procedure is called with the appropriate keywords
MODIFICATION HISTORY
Adapted from CONV_UNIX_VAX, W. Landsman   Hughes/STX    January, 1992
Added new integer datatypes  C. Markwardt/W. Landsman  July 2000
Use /SWAP_IF_LITTLE_ENDIAN keyword for 64bit types W. Landsman Feb 2003
Do not use XDR keywords to BYTEORDER for much improved speed
                         W. Landsman   April 2006