This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


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

java/3097: Divide by zero does not work with long



>Number:         3097
>Category:       java
>Synopsis:       Divide by zero does not work with long
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 08 16:56:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Aneesh Aggarwal
>Release:        gcc version 3.1 20010601 (experimental)
>Organization:
>Environment:
Linux 2.4 on x86
>Description:
On division by zero for a long, NO exception is thrown.
The program crashes.
It, however, works correctly for int.
>How-To-Repeat:
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");
        }
     }
   }
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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