[Cfp-interest 1640] TS3 missing conversions
Jim Thomas
jaswthomas at sbcglobal.net
Mon Jun 15 21:25:49 PDT 2020
This is an idea for discussion at the CFP meeting this Wednesday.
The current TS3 annex does not support IEC 60559 required conversions from binary format to decimal format where the source or destination ia a non-arithmetic interchange format (see table below). The following change enhances conversions from string to decimal format so that they accept hexadecimal input. With the change, the missing conversions would be done by converting the binary format input exactly to a floating number string in the hexadecimal form, then converting the hexadecimal string to decimal format.
+++++++++++++++
In X.2.2, append:
[] For implementations that supports both binary and decimal floating types and a (binary or decimal) non-arithmetic interchange format, the strtodN and strtodNx functions shall accept subject sequences that have the form of hexadecimal floating numbers and otherwise meet the requirements of subject sequences (7.22.1.6). Then the decimal results shall be correctly rounded if the subject sequence has at most M significant hexadecimal digits, where M >= ceil((P-1)/4) + 1 is implementation defined, and P is the maximum precision of the supported binary floating types and non-arithmetic formats. If all subject sequences of hexadecimal form are correctly rounded, M may be regarded as infinite. If the subject sequence has more than M significant hexadecimal digits, the implementation may first round to M significant hexadecimal digits according to the applicable rounding direction mode, signaling exceptions as though converting from a wider format, then correctly round the result of the shortened hexadecimal input to the result type.
+++++++++++++++
IEC 60559 requires conversions between all pairs of the following:
Binary interchange type
Binary extended type
Binary non-arithmetic format
Decimal interchange type
Decimal extended type
Decimal non-arithmetic format
String
The table below shows the conversions as supported in TS3-as-annex:
From\to
Binary interchange type
Binary extended type
Binary non-arithmetic format
Decimal interchange type
Decimal extended type
Decimal non-arithmetic format
string
Binary interchange type
Assignment, cast
Assignment, cast
Encode + encoding-to-encoding
Assignment, cast
Assignment, cast
1
Strfrom type
Binary extended type
Assignment, cast
Assignment, cast
Exact strfrom type + strto encoding
Assignment, cast
Assignment, cast
1
Strfrom type
Binary non-arithmetic format
Encoding-to-encoding + decode
Exact strfrom encoding + strto type
Encoding-to-encoding
1
1
1
Strfrom encoding
Decimal interchange type
Assignment, cast
Assignment, cast
Exact strfrom type + strto encoding
Assignment, cast
Assignment, cast
Encode + encoding-to-encoding
Strfrom type
Decimal extended type
Assignment, cast
Assignment, cast
Exact strfrom type + strto encoding
Assignment, cast
Assignment, cast
Exact strfrom type + strto encoding
Strfrom type
Decimal non-arithmetic format
Exact strfrom encoding + strto type
Exact strfrom encoding + strto type
Exact strfrom encoding + strto encoding
Encoding-to-encoding + decode
Exact strfrom encoding + strto type
Encoding-to-encoding
Strfrom encoding
string
Strto type
Strto type
Strto encoding
Strto type
Strto type
Strto encoding
NA
1) missing conversions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20200615/a2c4aa41/attachment-0001.htm>
More information about the Cfp-interest
mailing list