8029514: java/math/BigInteger/BigIntegerTest.java failing since thresholds adjusted in 8022181
authorbpb
Thu, 05 Dec 2013 07:44:59 -0800
changeset 21983 586d25bfe206
parent 21982 fd6e5fe509df
child 21984 4dff16390b67
8029514: java/math/BigInteger/BigIntegerTest.java failing since thresholds adjusted in 8022181 Summary: Ensure the value returned by getLower() is unsigned. Reviewed-by: darcy
jdk/src/share/classes/java/math/BigInteger.java
jdk/test/java/math/BigInteger/BigIntegerTest.java
--- a/jdk/src/share/classes/java/math/BigInteger.java	Thu Dec 05 18:04:12 2013 +0400
+++ b/jdk/src/share/classes/java/math/BigInteger.java	Thu Dec 05 07:44:59 2013 -0800
@@ -1815,7 +1815,7 @@
         int len = mag.length;
 
         if (len <= n) {
-            return this;
+            return abs();
         }
 
         int lowerInts[] = new int[n];
--- a/jdk/test/java/math/BigInteger/BigIntegerTest.java	Thu Dec 05 18:04:12 2013 +0400
+++ b/jdk/test/java/math/BigInteger/BigIntegerTest.java	Thu Dec 05 07:44:59 2013 -0800
@@ -56,32 +56,32 @@
     // Bit large number thresholds based on the int thresholds
     // defined in BigInteger itself:
     //
-    // KARATSUBA_THRESHOLD        = 50  ints = 1600 bits
-    // TOOM_COOK_THRESHOLD        = 75  ints = 2400 bits
-    // KARATSUBA_SQUARE_THRESHOLD = 90  ints = 2880 bits
-    // TOOM_COOK_SQUARE_THRESHOLD = 140 ints = 4480 bits
+    // KARATSUBA_THRESHOLD        = 80  ints = 2560 bits
+    // TOOM_COOK_THRESHOLD        = 240 ints = 7680 bits
+    // KARATSUBA_SQUARE_THRESHOLD = 128 ints = 4096 bits
+    // TOOM_COOK_SQUARE_THRESHOLD = 216 ints = 6912 bits
     //
-    // SCHOENHAGE_BASE_CONVERSION_THRESHOLD = 8 ints = 256 bits
+    // SCHOENHAGE_BASE_CONVERSION_THRESHOLD = 20 ints = 640 bits
     //
-    // BURNIKEL_ZIEGLER_THRESHOLD = 50  ints = 1600 bits
+    // BURNIKEL_ZIEGLER_THRESHOLD = 80  ints = 2560 bits
     //
-    static final int BITS_KARATSUBA = 1600;
-    static final int BITS_TOOM_COOK = 2400;
-    static final int BITS_KARATSUBA_SQUARE = 2880;
-    static final int BITS_TOOM_COOK_SQUARE = 4480;
-    static final int BITS_SCHOENHAGE_BASE = 256;
-    static final int BITS_BURNIKEL_ZIEGLER = 1600;
+    static final int BITS_KARATSUBA = 2560;
+    static final int BITS_TOOM_COOK = 7680;
+    static final int BITS_KARATSUBA_SQUARE = 4096;
+    static final int BITS_TOOM_COOK_SQUARE = 6912;
+    static final int BITS_SCHOENHAGE_BASE = 640;
+    static final int BITS_BURNIKEL_ZIEGLER = 2560;
 
     static final int ORDER_SMALL = 60;
     static final int ORDER_MEDIUM = 100;
     // #bits for testing Karatsuba
-    static final int ORDER_KARATSUBA = 1800;
+    static final int ORDER_KARATSUBA = 2760;
     // #bits for testing Toom-Cook and Burnikel-Ziegler
-    static final int ORDER_TOOM_COOK = 4000;
+    static final int ORDER_TOOM_COOK = 8000;
     // #bits for testing Karatsuba squaring
-    static final int ORDER_KARATSUBA_SQUARE = 3200;
+    static final int ORDER_KARATSUBA_SQUARE = 4200;
     // #bits for testing Toom-Cook squaring
-    static final int ORDER_TOOM_COOK_SQUARE = 4600;
+    static final int ORDER_TOOM_COOK_SQUARE = 7000;
 
     static final int SIZE = 1000; // numbers per batch