public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/13734] New: round()  gives random numbers
@ 2004-01-19  4:17 unruh at physics dot ubc dot ca
  2004-01-19  4:26 ` [Bug c/13734] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: unruh at physics dot ubc dot ca @ 2004-01-19  4:17 UTC (permalink / raw)
  To: gcc-bugs

The round() function outputs random numbers

#include <math.h>
main()
{
printf( "%f %f\n", round(1.0), round(1.0001));
}

Output
-2.000000 6.000000

However these values appear to be random, and can change on different 
machines and at different times on the same machine.

(Mandrake 9.0 and 9.1)
gcc -o test test.c -lm

-- 
           Summary: round()  gives random numbers
           Product: gcc
           Version: 3.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: unruh at physics dot ubc dot ca
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13734


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

end of thread, other threads:[~2004-01-19  4:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-19  4:17 [Bug c/13734] New: round() gives random numbers unruh at physics dot ubc dot ca
2004-01-19  4:26 ` [Bug c/13734] " 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).