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



             Bug #: 56399

           Summary: Adding int to float generates incorrect results

    Classification: Unclassified

           Product: gcc

           Version: 4.7.2

            Status: UNCONFIRMED

          Severity: blocker

          Priority: P3

         Component: c

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: johnfox...@yahoo.com





The following program demonstrates the bug. Tested with 32-bit GCC 4.7.2.



#include <stdio.h>

void main()

{

        int x = 1073760000;

        float f = 120000;

        f += x;

        printf("expected:%d\ncomputed:%f\n", x + 120000, f);

}

Reply via email to