This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/35712] New: decimal float literal constant zero loses significant trailing zeroes
- From: "janis at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Mar 2008 23:57:24 -0000
- Subject: [Bug c/35712] New: decimal float literal constant zero loses significant trailing zeroes
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Decimal floating point types support significant trailing zeroes to
specify how much precision a value has. Trailing zeroes are relevant
even for values of zero; for example, rounding 1.e-11dd to 10 places
after the decimal point results in 0.e-10dd.
The draft Technical Report N1241 for ISO/IEC TR 24732 doesn't specify
this directly, but section 9.5 "Formatted input/output specifiers"
shows expected output for five different representations of zero:
0, -0, 0.000000, 0e-07, and 0e+02.
Currently GCC converts all decimal float literal values of zero to
0.DF, 0.DD, or 0.DL.
I'm testing a patch to fix this but want a PR to record the issue.
--
Summary: decimal float literal constant zero loses significant
trailing zeroes
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: c
AssignedTo: janis at gcc dot gnu dot org
ReportedBy: janis at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35712