This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/79528] DFP double rounding bug
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 15 Feb 2017 17:45:04 +0000
- Subject: [Bug c/79528] DFP double rounding bug
- Auto-submitted: auto-generated
- References: <bug-79528-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79528
--- Comment #2 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
On Wed, 15 Feb 2017, jakub at gcc dot gnu.org wrote:
> It seems besides conversion from integer to decimal{32,64} also all the
> arithmetics e.g. in real_arithmetics are performed in _Decimal128 precision and
> rounded according to that and then rounded again to the corresponding
> _Decimal{32,64} type. As the precision in decimal digits of _Decimal64 is just
> 16 and _Decimal128 is 34 decimal digits, perhaps it is just fine for +/-, but
> not sure about multiplication or FMA (if we ever allow that for decimal float).
Multiplication is trivially OK (as the product of any two _Decimal64
numbers is exactly representable in _Decimal128).
Division and square root may well be OK but would require a more detailed
analysis.
Double rounding for fma is never OK (in round-to-nearest) as the product
of two values can be an exactly half-way value, which is then added to
something much smaller.