From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7372 invoked by alias); 31 Jul 2013 09:13:15 -0000 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 Received: (qmail 7300 invoked by uid 48); 31 Jul 2013 09:13:11 -0000 From: "guilliam.xavier at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug libc/15799] glibc div() code is broken Date: Wed, 31 Jul 2013 09:13:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: 2.18 X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: guilliam.xavier at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-07/txt/msg00195.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=15799 --- Comment #1 from Guilliam Xavier --- * I must make a small correction: assert(abs(q * D) <= abs(N)); is correct, but the following is actually not strictly equivalent: assert((r < 0) == (N < 0)); // sign(r) == sign(N) because we can have N == -10, D == 5 and q == -2, r == 0 (the quotient is exact), so I think a corrected equivalent would be rather: assert(r == 0 || (r < 0) == (N < 0)); (And just after that: typo: "discard" -> "discarded".) -- You are receiving this mail because: You are on the CC list for the bug.