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

Canonicity considerations in ISO/IEC/IEEE 60559:2011

A few questions on canonicity:    
A)  With respect to "declets": 
Clause 5.5.2, Decimal re-encoding operations, states in part "These operations may propagate non-canonical encodings". 
It seems to me that for both "decimalEncoding EncodeDecimal (decimal)" and "decimal DecodeDecimal (decimalEncoding)"  this could be the case.  Noncanonical declets could be (but are neither required to be nor prohibited from being) propagated into the result.   I would expect, but don't see it required, that the exponent would be preserved regardless -- that the "canonic exponent" would be that of the operand.  Have I got that right? 
For "binaryEncoding encodeBinary (decimal)'" it strikes me that no decimal value in the decimal encoding could exceed the maximum value permitted in that encoding; thus, a noncanonic significand representation in such a conversion from decimal encoding to binary encoding is impossible.  Have I got that right?   Also, what is the "preferred exponent" for the result of this encoding operation,  and where is it specified? 
For "decimal decodeBinary (binaryEncoding)",  the binary-encoded operand value, if it exceeded the maximum value permitted for the appropriate would be a non-canonic representation of zero,
because there are no non-canoic representations available in the decimal encoding  to represwent the value.  Non-canonical encodings could not result.  Have I got that right?  Also, what is the "preferred exponent" for the result of this decoding operation, and where is it specified?   
B)  Conversion of decimal character sequences that include exponents, is provided for by 5.12.2, External decimal character sequences representing finite values.  It seems to me that multiple representations could result -- e.g., the representations +0.001E+3 and +100.0e-2 all are of the integer value 1.  Are the "canonic" values for conversion of "+0.001e+3", "+100.0e-2", and "+1.0e0" all "1.0E+0"; do they have"preferred exponents of +3, -2, and 0 respectively; or is there some other specification?  I couldn't find the rules for this; if they exist, where are they?  
C)  Does ISO/IEC/IEEE 60559 provide for conversion of fixed-point non-integer binary values (COBOL provides for such, in which the explicit decimal point separates the integer and fractional portions of the value)?  Although one can apply the "brute force" method of treating the binary value as an integer and applying the power-of-ten arithmetically, I was unable to find such a specification in ISO/IEC/IEEE 60559.  If there is, where is it? 
Thanks to all for any feedback. 
   -Chuck Stevens 

754 | revision | FAQ | references | list archive