From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5692 invoked by alias); 15 Jul 2009 14:59:11 -0000 Received: (qmail 5596 invoked by uid 48); 15 Jul 2009 14:58:57 -0000 Date: Wed, 15 Jul 2009 14:59:00 -0000 Message-ID: <20090715145857.5595.qmail@sourceware.org> From: "Sylvain dot Pion at sophia dot inria dot fr" To: glibc-bugs@sources.redhat.com In-Reply-To: <20061107172025.3479.hack@watson.ibm.com> References: <20061107172025.3479.hack@watson.ibm.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug libc/3479] Incorrect rounding in strtod() X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2009-07/txt/msg00028.txt.bz2 ------- Additional Comments From Sylvain dot Pion at sophia dot inria dot fr 2009-07-15 14:58 ------- Besides the "Recommended practice" mentioned, Annex F on IEC 60559 floating-point arithmetic, also says : "Functions such as strtod that convert character sequences to floating types must honor the rounding direction." It seems like glibc does not honor this, as the following program illustrates by crashing (on x86_64-linux at least). #include #include #include int main() { fesetround(FE_UPWARD); double d = strtod("0.3", (char**) NULL); fesetround(FE_DOWNWARD); double e = strtod("0.3", (char**) NULL); assert(d != e); } -- http://sourceware.org/bugzilla/show_bug.cgi?id=3479 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.