Summary | |
script file | C:\My Documents\Java\Acceptance\arithmetic.html |
last modified | Thu Jul 11 15:20:46 PDT 2002 |
this run as of | Fri Jul 12 02:53:07 PDT 2002 |
The computer relies on arithmetic. Here we test a variety of arithmetic
operations expressed as 32 bit two's complement binary numbers (Java's
int).
ArithmeticAcceptor | |||||
x | y | + | - | * | / |
0 | 0 | 0 | 0 | 0 | 0 java.lang.ArithmeticException: / by zero at ArithmeticAcceptor.doCell(ArithmeticAcceptor.java:20) at Acceptor.doCells(Acceptor.java:78) at Acceptor.doRows(Acceptor.java:70) at ArithmeticAcceptor.doRows(ArithmeticAcceptor.java:10) at Acceptor.doTable(Acceptor.java:60) at Acceptor.doTables(Acceptor.java:51) at Acceptor.main(Acceptor.java:23) |
1 | 2 | 3 | -1 | 2 | 0.5 java.lang.NumberFormatException: 0.5 at java.lang.Long.parseLong(Long.java:319) at java.lang.Long.parseLong(Long.java:363) at Acceptor.parseLong(Acceptor.java:92) at Acceptor.equals(Acceptor.java:110) at ArithmeticAcceptor.doCell(ArithmeticAcceptor.java:20) at Acceptor.doCells(Acceptor.java:78) at Acceptor.doRows(Acceptor.java:70) at ArithmeticAcceptor.doRows(ArithmeticAcceptor.java:10) at Acceptor.doTable(Acceptor.java:60) at Acceptor.doTables(Acceptor.java:51) at Acceptor.main(Acceptor.java:23) |
1 | -1 | 0 | 2 | -1 | -1 |
10000 | 10000 | 20000 | 0 | 100000000 | 1 |
100000 | 100000 | 200000 | 0 | 10000000000 1410065408 |
1 |
1000000 | 1000000 | 2000000 | 0 | 1000000000000 -727379968 |
1 |
Document prepaired by Ward Cunningham
Last update July 11, 2002