I haven't' read all the notes in this thread, but I did think that some
additional information MIGHT help this discussion.

Re: "IEEE Floating Point"

What is meant by this term (and how does it relate to portability -
especially for IBM users)

In 2007, an official revision was made to the IEEE 754 Standard.

Before that time, when one referred to "IEEE Floating Point" this referred
to a binary format of floating point, like the (IBM specific) "hexadecimal"
floating point format, it was entirely possible to have "rounding" (or other
problems) when trying to do Decimal arithmetic with this format.  (precision
could be lost and/or rounding errors could arise).

With the 2007 revision, this is referred to as "binary interchange format"
(it still includes equivalent to "short," "long," "extended" and also
includes "quad" (basically double word).

See IBM references to "BFP"

However, with the 2007 revision, IEEE now supports a DECIMAL format for
floating point items (and for doing well-defined and portable arithmetic).
There are multiple "precisions" for this format.

Furthermore, there are different ways of encoding such data items:
  Decimal Encoding or Binary Encoding (of decimal significands and
exponents)
  big-endian or little-endian

IBM (on z/OS) uses decimal encoding, big-endian, decimal floating point
(DFP) and this is supported in Assembler and C/C++, PL/I (and IBM has
accepted a requirement to support this for COBOL as well).

Intel has support for
  binary encoded, little-endian, decimal floating point

HOWEVER, the IEEE 754 specification GUARANTEES that if you are using
"decimal floating point" items and arithmetic, you will always get the same
results for identical operations with identical values - regardless of
encoding or endian-ness.

HOWEVER, if you compare results done with "IEEE binary interchange format"
floating point and "IEEE decimal interchange format" you need NOT get the
same results (or the same exceptions).

Therefore, to answer the original question, you need to answer to other
questions:

1) On Windows (with IBM Visual C/C++) which "IEEE floating point" format are
you using?  If it is decimal interchange format, then you WILL get the same
results (always) on z/OS *WHEN* using DFP data and instructions.  This will
also guarantee CORRECT results - even for decimal arithmetic and with a
variety of options for rounding - as specified in IEEE 754.

2) If you are using Binary interchange formats on Windows, then you should
be using BFP on the mainframe.  Over the years, many shops and vendors have
developed libraries to do decimal arithmetic with such data items, but it is
still not (IMHO) a really good idea to do.  Furthermore, I do not believe
that IEEE guarantees identical results when
 convert decimal data to BFP
 do arithmetic in BFP
 Convert BFP back to decimal output
Therefore, I believe (but am not positive) that you would NOT be guaranteed
of getting identical results with IBM Visual C/C++ (on windows) and z/OS
Assembler - even if using "IEEE floating point"

Finally, "obviously" if you bring HFP into this mix, everything is up to IBM
as this is NOT an industry standard format.  You would need to check your
IBM documentation both for language and platform to determine if results
would be portable.

Reply via email to