[Bug c++/51559] New: decimal128 operates incorrectly compared to decimal32 and decimal64

mingodad at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Dec 14 22:56:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51559

             Bug #: 51559
           Summary: decimal128 operates incorrectly compared to decimal32
                    and decimal64
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mingodad@gmail.com


Created attachment 26092
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26092
Program that demostrates decimal128 fault

Testing the new decimal classes on g++ mingw4.6.1.2 with this program the
decimal32 and decimal64 are showing the expected answer but decimal128 doesn't
all parameters are equal but the result not.

With all 3 decimal classes three instances are created with the following
values:

std::decimal::decimal* dn(.3), dn2(.099), dn3(1000), dn4(201);
dn-=dn2;
dn*=dn3;
cout << "decimal* = "  << (dn==dn4) << " : " << decimal*_to_double(dn) << endl;

Expects "dn==dn4" on all but decimal128 fails.



More information about the Gcc-bugs mailing list