This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/21718] real.c rounding not perfect
- From: "neil at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Oct 2007 03:45:44 -0000
- Subject: [Bug middle-end/21718] real.c rounding not perfect
- References: <bug-21718-6@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from neil at gcc dot gnu dot org 2007-10-11 03:45 -------
(In reply to comment #1)
> We probably don't even get it right for all cases with DECIMAL_DIG digits for
> all long double formats (required by Annex F).
(In reply to comment #2)
> My reading of F.5#2 is that conversions of all numbers with DECIMAL_DIG
> significant figures are meant to be correct, not just of those which arise from
> converting a representable binary number to decimal (which we probably do get
> right). I don't think you'll get all conversions with DECIMAL_DIG digits right
> without at least 226 bits internal precision, and proving that any specific
> figure is enough would be hard.
I believe more than 160 bits are required to get even single-precision numbers
right with DECIMAL_DIG digits precision and an exponent. I'm going to try and
prove this by finding an example. It could be hard as I believe 160 is only
just below the required number.
I think to do DECIMAL_DIG digits correctly for long-double requires over 11,500
bits of precision.
I'm assuming above you're permitted to attach an exponent to your DECIMAL_DIG
digits; that's how I read the definition of DECIMAL_DIG anyway. The exponents
push up the required precision enormously.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21718