This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Divide by zero does not throw exception for longs
- To: java at gcc dot gnu dot org
- Subject: Divide by zero does not throw exception for longs
- From: Aneesh Aggarwal <aneesha at granite dot hpl dot hp dot com>
- Date: Mon, 11 Jun 2001 13:42:46 -0700 (PDT)
This is the 3.1 version. When compiled with gcj, divide by zero does not
exception for longs. For ints, however, it throws the exception. The
program I tested it on is :
public class div_test {
public static void main(String [] args) {
long a = 10, b = 0;
try {
a = a/b;
}
catch (java.lang.Exception e) {
System.out.println("Div by zero working");
}
}
}
I have filed a bug-report, the identification is java/3097. I thought I'll
mention it here so that it gets some attention and if the bug is present
in the 3.0 release, it might be fixed.
-Aneesh