This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/13734] New: round() gives random numbers
- From: "unruh at physics dot ubc dot ca" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Jan 2004 04:17:36 -0000
- Subject: [Bug c/13734] New: round() gives random numbers
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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