This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libgcj/11666] New: GCJ generates 0 instead of the maximum integer
- From: "michael dot diloreto at hp dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Jul 2003 23:41:39 -0000
- Subject: [Bug libgcj/11666] New: GCJ generates 0 instead of the maximum integer
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11666
Summary: GCJ generates 0 instead of the maximum integer
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: michael dot diloreto at hp dot com
CC: gcc-bugs at gcc dot gnu dot org
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.