From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17563 invoked by alias); 16 Mar 2006 08:30:56 -0000 Received: (qmail 17535 invoked by uid 48); 16 Mar 2006 08:30:53 -0000 Date: Thu, 16 Mar 2006 08:30:00 -0000 Message-ID: <20060316083053.17534.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libfortran/24685] real(16) formatted input is broken for huge values In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jb at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-03/txt/msg01669.txt.bz2 List-Id: ------- Comment #13 from jb at gcc dot gnu dot org 2006-03-16 08:30 ------- (In reply to comment #12) > The attached C program fails on IA64 because the printf rounds the last digit > of MIN_LDBL down when it prints it and so it can't be read back in. The basic > problem is that LDBL_MAX and LDBL_MIN (or for that matter DBL_MIN and DBL_MAX) > cannot be represented exactly in decimal form so printf has to do some rounding > that may make the process non-reversable when trying to go back via strtod or > strtold. Ah, I see. Well, IMHO formatted IO of FOO_MAX/MIN is a rather obscure corner case, so I think a good enough solution would be to change the testcase to instead test with FOO_MAX/2 and FOO_MIN*2 (just to check that we have large enough field widths etc. and not worry about rounding out of range). But I'll ask the standards gurus on c.l.f first to make sure. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24685