SPL to HP C/XL Migration Guide (30231-90001)

1-4
remaining SPL code (e.g., in subprograms). See the
Switch Programming
User's Guide
for details.
The following chapters parallel the
Systems Programming Language
Reference Manual
, section for section, discussing the conversion issues
involved.
Major Considerations
MPE V and MPE XL have two areas of incompatibility that may make it
difficult for you to convert SPL programs to HP C/XL:
* The representation of floating-point numbers
* Data storage alignment
Floating-Point Numbers
MPE XL floating-point numbers are represented in the industry-standard
IEEE format. This format is different from the MPE V format in bit
layout, range, and precision. (Range is governed by the size of the
exponent; precision is governed by the size of the fraction.)
MPE V 32-bit floating-point numbers:
Bit layout: 1-bit sign, 9-bit exponent, 22-bit fraction
Nonzero range: 8.63617x10-78 to 1.157921x1077
MPE XL 32-bit floating-point numbers:
Bit layout: 1-bit sign, 8-bit exponent, 23-bit fraction
Nonzero range: 1.754944x10-38 to 3.4028235x1038
MPE V 64-bit floating-point numbers:
Bit layout: 1-bit sign, 9-bit exponent, 54-bit fraction
Nonzero range: 8.63618555094445x10-78 to 1.157920892373162x1077
MPE XL 64-bit floating-point numbers:
Bit layout: 1-bit sign, 11-bit exponent, 52-bit fraction
Nonzero range: 2.2250738585072014x10-308to 1.7976931348623157x10308
MPE XL 32-bit floating point has greater precision but a smaller range
than MPE V. Thus, it is possible to have a valid MPE V floating-point
number that is not representable in MPE XL floating point.
On the other hand, MPE XL 64-bit floating-point numbers can handle a much
higher range than MPE V 32-bit or 64-bit floating point, but they have
less precision than MPE V 64-bit floating point.
The data storage formats are quite different, corresponding to the bit