This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/12203] New: nearbyint returns always 895
- From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Sep 2003 21:17:24 -0000
- Subject: [Bug c/12203] New: nearbyint returns always 895
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12203
Summary: nearbyint returns always 895
Product: gcc
Version: 3.0.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sk at mathematik dot uni-ulm dot de
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
Calling nearbyint returns always 895.0
Environment:
System: Linux johann 2.4.21 #2 Sun Aug 17 20:52:39 CEST 2003 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ./configure --enable-languages=c++
How-To-Repeat:
Compile and run:
#include <math.h>
#include <stdio.h>
void show (double x)
{
printf("nearbyint(%+.3e) = %d\n", x, (int)(nearbyint(x)));
if(0.0 == x) return;
x = -x;
printf("nearbyint(%+.3e) = %d\n", x, (int)(nearbyint(x)));
x = 1/x;
printf("nearbyint(%+.3e) = %d\n", x, (int)(nearbyint(x)));
x = -x;
printf("nearbyint(%+.3e) = %d\n", x, (int)(nearbyint(x)));
}
int main ()
{
show(1.1);
show(11);
show(111.1);
}