Bug 11666

Summary: GCJ generates 0 instead of the maximum integer
Product: gcc Reporter: Michael Di Loreto <michael.diloreto>
Component: libgcjAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED DUPLICATE    
Severity: normal CC: gcc-bugs, java-prs
Priority: P2    
Version: 3.3   
Target Milestone: 3.4.0   
See Also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115161
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:

Description Michael Di Loreto 2003-07-24 23:41:38 UTC
When converting from a float value to an integer, if the float value is too 
large, the result is 0 instead of the maximum integer. Here's the test.
class FloatBug {
    public static void main ( String[] args ) {
        int i = (int) 3.4e+32f;
        System.out.println ( "(int) 3.4e+32f = " + i );
    }
}
The answer should be 2147483647.
Comment 1 Andrew Pinski 2003-07-24 23:47:12 UTC
This is a dup of bug 6391 which is known bug.

*** This bug has been marked as a duplicate of 6391 ***