This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51559] decimal128 operates incorrectly compared to decimal32 and decimal64
- From: "kubry at terra dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 15 Aug 2013 13:59:29 +0000
- Subject: [Bug c++/51559] decimal128 operates incorrectly compared to decimal32 and decimal64
- Auto-submitted: auto-generated
- References: <bug-51559-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51559
Ganton <kubry at terra dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kubry at terra dot com
--- Comment #3 from Ganton <kubry at terra dot com> ---
> The problem is inherent to using floating points to initialize decimal128
Instead of:
- Using a floating point to initialize a decimal128.
- Dividing integers to initialize a decimal128.
people can use a decimal number to initialize a decimal128.
In the prior examples, instead of
std::decimal::decimal128 dn(.3), dn2(.099), dn3(1000), dn4(201);
people can use
std::decimal::decimal128 dn(.3dl), dn2(.099dl), dn3(1000), dn4(201);