package test;

public class LongMath {
  public static void main(String[] args) {
    long a = 1;
    long b = 0;
    long c;
    try {
      c = a / b;
    }
    catch (ArithmeticException e) {
      System.out.println("Caught ArithmeticException as expected: " + e.getMessage());
    }

    try {
      c = a % b;
    }
    catch (ArithmeticException e) {
      System.out.println("Caught ArithmeticException as expected: " + e.getMessage());
    }

    runOps(5, 3);
    runOps(-5, 3);
    runOps(5, -3);
    runOps(Long.MAX_VALUE, Long.MAX_VALUE);
    runOps(Long.MAX_VALUE, Long.MIN_VALUE);
    runOps(Long.MIN_VALUE, Long.MAX_VALUE);
    runOps(Long.MIN_VALUE, Long.MIN_VALUE);

    runSmallOps(5, 3);
    runSmallOps(-5, 3);
    runSmallOps(5, -3);
  }

  public static void runOps(long a, long b) {
    long c = a + b;
    System.out.println(a + " + " + b + " = " + c);
    c = a - b;
    System.out.println(a + " - " + b + " = " + c);
    c = a / b;
    System.out.println(a + " / " + b + " = " + c);
    c = a % b;
    System.out.println(a + " % " + b + " = " + c);
  }

  // our implementation has yet to support these operations on large integers.
  public static void runSmallOps(long a, long b) {
    long c = a * b;
    System.out.println(a + " * " + b + " = " + c);
    c = a << b;
    System.out.println(a + " << " + b + " = " + c);
    c = a >> b;
    System.out.println(a + " >> " + b + " = " + c);
    c = a | b;
    System.out.println(a + " | " + b + " = " + c);
    c = a ^ b;
    System.out.println(a + " ^ " + b + " = " + c);
  }
}

@@ -680,80 +680,8 @@
 UE);
-%0A%0A    runSmallOps(5, 3);%0A    runSmallOps(-5, 3);%0A    runSmallOps(5, -3);
 %0A  %7D
@@ -1003,149 +1003,9 @@
 ;%0A  
-%7D%0A%0A  // our implementation has yet to support these operations on large integers.%0A  public static void runSmallOps(long a, long b) %7B%0A    long
+ 
  c =
@@ -1143,24 +1143,24 @@
 c = a %3E%3E b;%0A
-
     System.o
@@ -1191,32 +1191,102 @@
 b + %22 = %22 + c);%0A
+    c = a %3E%3E%3E b;%0A    System.out.println(a + %22 %3E%3E%3E %22 + b + %22 = %22 + c);%0A
     c = a %7C b;%0A 

Test for lushr, & remove distinction between short and long tests.