This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/41049] conversion from integer to decimal float loses trailing zeros
- 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: 18 Sep 2009 17:04:46 -0000
- Subject: [Bug c/41049] conversion from integer to decimal float loses trailing zeros
- References: <bug-41049-4503@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from janis at gcc dot gnu dot org 2009-09-18 17:04 -------
Subject: Bug 41049
Author: janis
Date: Fri Sep 18 17:03:55 2009
New Revision: 151857
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=151857
Log:
PR c/41049
* real.c decimal_from_integer, decimal_integer_string): New.
(real_from_integer): Use them as special case for decimal float.
* config/dfp-bit.c (_si_to_sd, _usi_to_sd): Use default rounding.
(_di_to_sd, _di_to_dd, _di_to_td, _udi_to_sd, _udi_to_dd, _udi_to_td):
Do not append zero after the decimal point in string to convert.
* dfp/pr41049.c: New test.
Added:
branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/dfp/pr41049.c
Modified:
branches/gcc-4_4-branch/gcc/ChangeLog
branches/gcc-4_4-branch/gcc/config/dfp-bit.c
branches/gcc-4_4-branch/gcc/real.c
branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41049