public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/12203] New: nearbyint returns always 895
@ 2003-09-07 21:17 gcc-bugzilla at gcc dot gnu dot org
  2003-09-07 21:24 ` [Bug c/12203] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2003-09-07 21:17 UTC (permalink / raw)
  To: gcc-bugs

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);
}


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c/12203] nearbyint returns always 895
  2003-09-07 21:17 [Bug c/12203] New: nearbyint returns always 895 gcc-bugzilla at gcc dot gnu dot org
@ 2003-09-07 21:24 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-09-07 21:24 UTC (permalink / raw)
  To: gcc-bugs

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-09-07 21:24 -------
Did you read http://gcc.gnu.org/bugs.html, at all?
`Before reporting that GCC compiles your code incorrectly, please compile it with gcc -Wall and 
see whether this shows anything wrong with your code that could be the cause instead of a bug in 
GCC.'

gcc -Wall pr12203.c -lm
pr12203.c: In function `show':
pr12203.c:6: warning: implicit declaration of function `nearbyint'

So this is a glibc bug in math.h then and not a GCC bug at all.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-09-07 21:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-07 21:17 [Bug c/12203] New: nearbyint returns always 895 gcc-bugzilla at gcc dot gnu dot org
2003-09-07 21:24 ` [Bug c/12203] " pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).