This is the mail archive of the java-discuss@sourceware.cygnus.com 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]

SIGFPE -> ArithmeticException ?


gcj doesn't seem to throw an ArithmeticException when a SIGFPE occurs
(x86, glibc). Instead, it dies and prints "Aborted".

Test code:

public class DivByZero
{
  public static void main(String args[])
   {
     try
     {
       int a = 1000;
       int b = 0;
       int c = a/b;
     }
     catch (ArithmeticException x)
     {
       System.out.println("Good, we tried to divide by zero:");
       System.out.println(x);
     }
  }
}

regards

  [ bryce ]



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