--- old/test/java/lang/Math/CubeRootTests.java 2014-08-15 13:26:12.000000000 +0800 +++ new/test/java/lang/Math/CubeRootTests.java 2014-08-15 13:26:11.000000000 +0800 @@ -25,10 +25,13 @@ * @test * @bug 4347132 4939441 * @summary Tests for {Math, StrictMath}.cbrt + * @library /lib/testlibrary + * @build jdk.testlibrary.DoubleUtils jdk.testlibrary.FloatUtils + * @run main CubeRootTests * @author Joseph D. Darcy */ -import sun.misc.DoubleConsts; +import static jdk.testlibrary.DoubleUtils.*; public class CubeRootTests { private CubeRootTests(){} @@ -93,13 +96,13 @@ } // Test cbrt(2^(3n)) = 2^n. - for(int i = 18; i <= DoubleConsts.MAX_EXPONENT/3; i++) { + for(int i = 18; i <= Double.MAX_EXPONENT/3; i++) { failures += testCubeRootCase(Math.scalb(1.0, 3*i), Math.scalb(1.0, i) ); } // Test cbrt(2^(-3n)) = 2^-n. - for(int i = -1; i >= DoubleConsts.MIN_SUB_EXPONENT/3; i--) { + for(int i = -1; i >= MIN_SUB_EXPONENT/3; i--) { failures += testCubeRootCase(Math.scalb(1.0, 3*i), Math.scalb(1.0, i) ); } @@ -110,10 +113,10 @@ // is less than the number of bits in a double's significand. long exponentBits1 = Double.doubleToLongBits(Math.scalb(1.0, 55)) & - DoubleConsts.EXP_BIT_MASK; + EXP_BIT_MASK; long exponentBits2= Double.doubleToLongBits(Math.scalb(1.0, -55)) & - DoubleConsts.EXP_BIT_MASK; + EXP_BIT_MASK; for(int i = 0; i < 100; i++) { // Take 16 bits since the 17th bit is implicit in the // exponent @@ -121,14 +124,14 @@ Double.longBitsToDouble(exponentBits1 | // Significand bits ((long) (rand.nextInt() & 0xFFFF))<< - (DoubleConsts.SIGNIFICAND_WIDTH-1-16)); + (SIGNIFICAND_WIDTH-1-16)); failures += testCubeRootCase(input1*input1*input1, input1); double input2 = Double.longBitsToDouble(exponentBits2 | // Significand bits ((long) (rand.nextInt() & 0xFFFF))<< - (DoubleConsts.SIGNIFICAND_WIDTH-1-16)); + (SIGNIFICAND_WIDTH-1-16)); failures += testCubeRootCase(input2*input2*input2, input2); } @@ -240,7 +243,7 @@ double pcNeighborsStrictCbrt[] = new double[5]; // Test near cbrt(2^(3n)) = 2^n. - for(int i = 18; i <= DoubleConsts.MAX_EXPONENT/3; i++) { + for(int i = 18; i <= Double.MAX_EXPONENT/3; i++) { double pc = Math.scalb(1.0, 3*i); pcNeighbors[2] = pc; @@ -279,7 +282,7 @@ } // Test near cbrt(2^(-3n)) = 2^-n. - for(int i = -1; i >= DoubleConsts.MIN_SUB_EXPONENT/3; i--) { + for(int i = -1; i >= MIN_SUB_EXPONENT/3; i--) { double pc = Math.scalb(1.0, 3*i); pcNeighbors[2] = pc;