This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Divide by zero does not throw exception for longs




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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]