All

As others have said, differences in floating point results between
platforms, operating systems, and compiler versions can be attributed to
differences in arithmetic software operation instruction sequences as well
as in floating point hardware support differences.  Even on the same
platform with same OS, a change in the version level of the same compiler
such as C, COBOL, or PL/I can change the results of floating operations
due to changes in optimization code generation.  For example a compiler
that recognizes multiple constants in an expression might reduce a
multiply and divide by two constants in an operation to a single multiply
by a calculated fraction which may be irrational which may introduce
differences.

As another example, the z390 portable mainframe assembler package was
written in J2SE Java for portability and supports HFP, BFP, and DFP short,
long, and extended precision HLASM compatible data fields and instructions
running on Windows and Linux.  The native java float format uses IEEE
binary format and native platform instructions if the JVM finds them
available on the host platform.  All the other floating point formats
supported by z390 must be emulated using the Big Decimal class which can
result in the introduction of errors.  For example a recent z390 fix
increased the number of guard digits used in the calculation of HFP long
constants to avoid differences in the last several bits of the resulting
hex base 16 value after conversion and rounding from base 10 constant.

Don Higgins
[email protected]

Reply via email to