All pastes #972263 Raw Edit

Untitled

public text v1 · immutable
·published 2008-04-05 09:16 UTC
rendered paste body
import java.math.BigDecimal;

public class DivideByZero {

	public static void main(String[] args) {
		BigDecimal one = BigDecimal.ONE;
		BigDecimal x = BigDecimal.ONE;
		BigDecimal i = BigDecimal.ONE;
		while (true) {
			try {
				i = one.divide(x);
				System.out.println(one + " / " + x + " = " + i);
			} catch (ArithmeticException ex) {
				System.out.println("Error dividing " + one + " by " + x);
			}
                        x = x.add(x);
			try { Thread.sleep(500); } catch (Exception ex) {}
		}
	}
}