From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27259 invoked by alias); 11 Oct 2007 03:45:55 -0000 Received: (qmail 27219 invoked by uid 48); 11 Oct 2007 03:45:44 -0000 Date: Thu, 11 Oct 2007 03:45:00 -0000 Message-ID: <20071011034544.27217.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/21718] real.c rounding not perfect In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "neil at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-10/txt/msg01077.txt.bz2 ------- 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