From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15817 invoked by alias); 21 Dec 2012 13:29:22 -0000 Received: (qmail 15623 invoked by uid 48); 21 Dec 2012 13:29:02 -0000 From: "ian at airs dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/55771] Negation and type conversion incorrectly exchanged Date: Fri, 21 Dec 2012 13:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: ian at airs dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status Last reconfirmed Resolution Ever Confirmed Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2012-12/txt/msg02118.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55771 Ian Lance Taylor changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |NEW Last reconfirmed| |2012-12-21 Resolution|INVALID | Ever Confirmed|0 |1 --- Comment #6 from Ian Lance Taylor 2012-12-21 13:29:01 UTC --- -3UL is not outside the range of float. -3UL == 0xfffffffffffffffd. That is less than FLT_MAX == 3.40282e+38. It is true that the value can not be precisely represented in float, but it is not out of range. So the standard says that the compiler must pick the nearest representable value, either higher or lower.