This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/13734] New: round() gives random numbers


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]