Bug 11666 - GCJ generates 0 instead of the maximum integer
Summary: GCJ generates 0 instead of the maximum integer
Status: RESOLVED DUPLICATE of bug 6391
Alias: None
Product: gcc
Classification: Unclassified
Component: libgcj (show other bugs)
Version: 3.3
: P2 normal
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-24 23:41 UTC by Michael Di Loreto
Modified: 2024-05-22 01:13 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***