[Bug c/13734] New: round() gives random numbers
unruh at physics dot ubc dot ca
gcc-bugzilla@gcc.gnu.org
Mon Jan 19 04:17:00 GMT 2004
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
More information about the Gcc-bugs
mailing list