@@ -15,10 +15,10 @@ public class BigIntTest {
1515 // Test some specific cases
1616 @ Test
1717 public void TestSpecificCases () {
18- TestCommon .DoTestRemainder (
19- "-2472320648" ,
20- "2831812081" ,
21- "359491433 " );
18+ TestCommon .DoTestDivide ( "2472320648" , "2831812081" , "0" );
19+ TestCommon . DoTestDivide ( "-2472320648" , "2831812081" , "0" );
20+ TestCommon . DoTestRemainder ( "2472320648" , "2831812081" , "2472320648" );
21+ TestCommon . DoTestRemainder ( "-2472320648" , "2831812081" , "-2472320648 " );
2222 TestCommon .DoTestMultiply (
2323"39258416159456516340113264558732499166970244380745050" ,
2424"39258416159456516340113264558732499166970244380745051" ,
@@ -47,11 +47,9 @@ public void TestToString() {
4747 @ Test
4848 public void TestMultiplyDivide () {
4949 FastRandom r = new FastRandom ();
50- for (int i = 0 ; i < 4000 ; ++i ) {
50+ for (int i = 0 ; i < 10000 ; ++i ) {
5151 BigInteger bigintA = RandomObjects .RandomBigInteger (r );
5252 BigInteger bigintB = RandomObjects .RandomBigInteger (r );
53- bigintA = BigInteger .fromString ("-2472320648" );
54- bigintB = BigInteger .fromString ("2831812081" );
5553 // Test that A*B/A = B and A*B/B = A
5654 BigInteger bigintC = bigintA .multiply (bigintB );
5755 BigInteger bigintRem ;
@@ -100,10 +98,7 @@ public void TestMultiplyDivide() {
10098BigInteger [] divrem =(bigintA ).divideAndRemainder (bigintB );
10199bigintC = divrem [0 ];
102100bigintRem = divrem [1 ]; }
103- System .out .println (bigintC );
104- System .out .println (bigintRem );
105101 bigintD = bigintB .multiply (bigintC );
106- System .out .println (bigintD );
107102 bigintD = bigintD .add (bigintRem );
108103 if (!bigintD .equals (bigintA )) {
109104 Assert .assertEquals ("TestMultiplyDivide " + bigintA + "; " + bigintB ,bigintA ,bigintD );
0 commit comments