This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Divide by zero does not throw exception for longs
- To: Andrew Haley <aph at cambridge dot redhat dot com>
- Subject: Re: Divide by zero does not throw exception for longs
- From: Aneesh Aggarwal <aneesha at granite dot hpl dot hp dot com>
- Date: Tue, 12 Jun 2001 10:43:05 -0700 (PDT)
- cc: java at gcc dot gnu dot org
It works correctly for libjava/testsuite/libjava.lang/Divide_1.java. In
Divide_1.java, if instead of
long a = Long.parseLong ("8000", 16);
long b = Long.parseLong ("0", 16);
long c = a/b;
something like this is done :
long a = 8000;
long b = 0;
long c = a/b;
then again it fails. If in any of the cases parseLong is used, then it
works fine.
-Aneesh
> Aneesh Aggarwal writes:
> >
> >
> > 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.
>
> That's strange: this case is explicitly tested for in
> libjava/testsuite/libjava.lang/Divide_1.java. Can you try that
> program on your system, please?
>