Author(s): J. Zoll, M. Jonker, M. Roethlisberger | Library: KERNLIB |
Submitter: | Submitted: 30.11.1986 |
Language: Fortran or Assembler | Revised: 01.04.1994 |
These routines convert vectors of single- or double- precision numbers between the internal and the standard IEEE representations.
Structure:
SUBROUTINE subprograms
User Entry Names: IE3FOS, IE3FOD, IE3TOS,
IE3TOD
Usage:
IEEE for/to internal, single precision:
CALL IE3FOS(VSINGL,VIEEES,NV,JCODE) CALL IE3TOS(VIEEES,VSINGL,NV,JCODE)
CALL IE3FOD(VDOUBL,VIEEED,NV,JCODE) CALL IE3TOD(VIEEED,VDOUBL,NV,JCODE)
Notes:
The IEEE format provides for representing
exceptions, both for single and for double precision:
a) Not-a-number: | single | 7F8nnnnn, | |
double | 7FFnnnnn... . | ||
b) Positive infinity: | single | 7F800000, | |
double | 7FF00000... . | ||
c) Negative infinity: | single | FF800000, | |
double | FFF00000... . |
Depending on the machine, mapping is done either naturally
or artificially:
CDC | Indefinite maps to not-a-number, overflow to infinity. | ||
CRAY | Overflow maps to infinity, not-a-number gives overflow. | ||
IBM | Positive infinity | maps to internal 7FFFFFF0, | |
not-a-number | maps to internal 7FFFFFFF. | ||
NORD | Positive infinity | maps to internal 177...70, | |
not-a-number | maps to internal 177...77. | ||
VAX | Positive infinity | maps to internal 00007F81, | |
not-a-number | maps to internal 00008001. |
On the VAX: if a file has been imported from a big-endian machine, byte-inversion (see VXINV (M434)) has to be done before calling IE3TOx; similarly byte-inversion has to be done after calling IE3FOx and before exporting the file.
On machines where the internal representation is IEEE (Apollo,
Sun, Silicon Graphics, etc) these routines are simple copy operations.