This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/21720] New: GCC incorrectly rounds hex floats
- From: "neil at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 May 2005 15:01:16 -0000
- Subject: [Bug c/21720] New: GCC incorrectly rounds hex floats
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Unlike decimal floats, correctly rounding hex floats is easy and cheap, so we
should do it. Moreover the standard requires it.
With -Wall GCC complains that the following function is missing a return
statement because it has incorrectly folded the comparison to false.
int foo(void) { if (0x1.0000010000000000000000000000000000000001p0f != 1) return
1; }
Remove one of the long line of zeroes and the precision falls within GCC's
limits and it works.
--
Summary: GCC incorrectly rounds hex floats
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: neil at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21720