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).
| eg.ArithmeticFixture | |||||
| x | y | + | - | * | / |
| 0 | 0 | 0 | 0 | 0 | 0System.DivideByZeroException: Attempted to divide by zero. at eg.ArithmeticFixture.doCell(Parse cell, Int32 column) in C:\projects\fit-b030825cs\dotnet\Source\eg\ArithmeticFixture.cs:line 29 at fit.Fixture.doCells(Parse cells) in C:\projects\fit-b030825cs\dotnet\Source\fit\Fixture.cs:line 137 |
| 1 | 2 | 3 | -1 | 2 | 0.5System.FormatException: Input string was not in a correct format. at System.Number.ParseInt64(String s, NumberStyles style, NumberFormatInfo info) at System.Int64.Parse(String s) at fit.PrimitiveFixture.parseLong(Parse cell) in C:\projects\fit-b030825cs\dotnet\Source\fit\PrimitiveFixture.cs:line 13 at fit.PrimitiveFixture.check(Parse cell, Int64 actual) in C:\projects\fit-b030825cs\dotnet\Source\fit\PrimitiveFixture.cs:line 37 at eg.ArithmeticFixture.doCell(Parse cell, Int32 column) in C:\projects\fit-b030825cs\dotnet\Source\eg\ArithmeticFixture.cs:line 29 at fit.Fixture.doCells(Parse cells) in C:\projects\fit-b030825cs\dotnet\Source\fit\Fixture.cs:line 137 |
| 1 | -1 | 0 | 2 | -1 | -1 |
| 10000 | 10000 | 20000 | 0 | 100000000 | 1 |
| 100000 | 100000 | 200000 | 0 | 10000000000 expected 1410065408 actual |
1 |
| 1000000 | 1000000 | 2000000 | 0 | 1000000000000 expected -727379968 actual |
1 |
| eg.ArithmeticColumnFixture | |||||
| x | y | plus() | times() | divide() | floating() |
| 2 | 3 | 5 | 6 | 0 | 0.6666667 |
| 0 | 0 | 0 | 0 | error | error expected NaN actual |
| 0 | 0 | 0 | 0 | error | NaN |
| 200 | 300 | 500 | 60000 | 0 | 0.6666667 |
| 2 | 3 | 10 expected 5 actual |
10 expected 6 actual |
10 expected 0 actual |
|
| 200 | 3 | 5 expected 203 actual |
6 expected 600 actual |
0 expected 66 actual |
0.6666667 expected 66.66666 actual |
| 2 | -3 | -1 | -6 | -0 | -0.6666667 |
| fit.Summary | |
| counts | 37 right, 10 wrong, 0 ignored, 2 exceptions |
| fixture path | build;build\bin;obj;bin;bin\Debug;bin\Release |
| input file | ..\Documents\arithmetic.html |
| input update | 8/23/2003 4:15:06 PM |
| output file | report\arithmetic.html |
| run date | 8/25/2003 4:14:30 PM |
| run elapsed time | 0:00.04 |
Document prepaired by Ward Cunningham
First Version July 11, 2002
Last Update August 17, 2002