test/java/lang/Math/CubeRootTests.java

Print this page

        

*** 26,37 **** * @bug 4347132 4939441 * @summary Tests for {Math, StrictMath}.cbrt * @author Joseph D. Darcy */ - import sun.misc.DoubleConsts; - public class CubeRootTests { private CubeRootTests(){} static final double infinityD = Double.POSITIVE_INFINITY; static final double NaNd = Double.NaN; --- 26,35 ----
*** 91,101 **** double d = i; failures += testCubeRootCase(d*d*d, (double)i); } // Test cbrt(2^(3n)) = 2^n. ! for(int i = 18; i <= DoubleConsts.MAX_EXPONENT/3; i++) { failures += testCubeRootCase(Math.scalb(1.0, 3*i), Math.scalb(1.0, i) ); } // Test cbrt(2^(-3n)) = 2^-n. --- 89,99 ---- double d = i; failures += testCubeRootCase(d*d*d, (double)i); } // Test cbrt(2^(3n)) = 2^n. ! 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.
*** 238,248 **** double pcNeighbors[] = new double[5]; double pcNeighborsCbrt[] = new double[5]; double pcNeighborsStrictCbrt[] = new double[5]; // Test near cbrt(2^(3n)) = 2^n. ! for(int i = 18; i <= DoubleConsts.MAX_EXPONENT/3; i++) { double pc = Math.scalb(1.0, 3*i); pcNeighbors[2] = pc; pcNeighbors[1] = Math.nextDown(pc); pcNeighbors[0] = Math.nextDown(pcNeighbors[1]); --- 236,246 ---- double pcNeighbors[] = new double[5]; double pcNeighborsCbrt[] = new double[5]; double pcNeighborsStrictCbrt[] = new double[5]; // Test near cbrt(2^(3n)) = 2^n. ! for(int i = 18; i <= Double.MAX_EXPONENT/3; i++) { double pc = Math.scalb(1.0, 3*i); pcNeighbors[2] = pc; pcNeighbors[1] = Math.nextDown(pc); pcNeighbors[0] = Math.nextDown(pcNeighbors[1]);