# HEX - hex floating point conversion routines.

### Usage:

<type> in, out
...
call XXtoYY(in, out)

or

<type> in, out, XXtoYY
...
out = XXtoYY(in)

### Where:

- <type>
- if one of the floating point types "real",
"double precision", "complex" or
"double complex".
- in
- is an expression of type "<type>" in the
floating representation being converted from.
- out
- is a variable of type "<type>" and will
receive a value in the converted represention.
- XXtoYY
- is the name of the conversion routine. One of
"XX" or "YY" must be the letters
"hx". Routines of the form "XXtohx"
convert from binary floating point to hex floating point;
routines of the form "hxtoYY" convert to binary
floating point from hex floating point. The other of
"XX" or "YY" is chosen to agree with
"<type>".
- s
- for real (single precision).
- d
- for double precision.
- c
- for complex.
- cd
- for double complex.

### Examples:

hexone = stohx(1.0)

### Description:

Fortran 77 supports two floating point representations, binary
(base 2) and hex (base 16). Both representations use the same
number of bits to represent the exponent and mantissa. Hex
floating point has a larger dynamic range, but is less accurate
and has some nasty (and surprising) numerical properties.

A given program will do all its calculations in only 1 format.
However, it may have to read or write a data file for a program
that uses the other format. To help with this, the library
supplies eight routines to convert between formats. These
routines just convert between formats; they do not do any
calculations so they work with programs that use either floating
point format.

These routines can be called as a two argument subroutine, or
as a single argument functions of the appropriate type.

### Notes:

Some sites disable hex mode entirely with during system
startup.

Copyright © 1996, Thinkage Ltd.