[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Canonicity considerations in ISO/IEC/IEEE 60559:2011



This is a delayed response to Chuck Stevens' post of 9 Oct 2011.

(A) DFP re-encoding operations of clause 5.5.2.

These operations permit conversion between the native DFP encoding
and explicit DPD or BID encodings.  The reason non-canonicity is
permitted to be propagated is that when the native encoding matches
the explicitly-requested one, a blind copy operation is permitted.

There is no ambiguity about what happens to the exponent, because
the result must represent EXACTLY the same FP datum, cohort and all,
as the source.  So there is no concept of "preferred exponent".

(B) Clause 5.12.2, conversion to/from decimal character strings.

The layout of the character string is expected to be controlled
by a format operand, e.g. COBOL's PICTURE or C's printf %e, %f
etc. specifications -- and one of them is supposed to preserve
the quantum, so that the least significant digit of the result
corresponds to the least-significant source digit.

Clause 5.4.2 mentions the preferred exponent for conversion from
character string to DFP, and it should again be the one that
makes the least significant digits correspond to each other.

(C) Conversion of non-integral fixed-point values.

Nothing is said about these in 754.  The interpretation is pretty
clear however:  A fixed-point number is an integer times a scale factor,
and the latter represents a power of the base, typically two or ten.
So a combination of multiplication and conversion to/from integer would
be used, in the appropriate order.  From the point of view of 754 it
would not be a single operation.

Michel.

(Sorry of the delay -- I was forcefully unsubscribed last March, and
just finished reconstituting my 754 archive.  There are a couple of
posts from March 2011 that piqued my attention as well.)
---Sent: 2012-01-23 02:26:37 UTC


754 | revision | FAQ | references | list archive