test/java/lang/Math/CeilAndFloorTests.java

Print this page

        

*** 23,36 **** /* * @test * @bug 6908131 * @summary Check for correct implementation of Math.ceil and Math.floor */ - import sun.misc.DoubleConsts; - public class CeilAndFloorTests { private static int testCeilCase(double input, double expected) { int failures = 0; failures += Tests.test("Math.ceil", input, Math.ceil(input), expected); failures += Tests.test("StrictMath.ceil", input, StrictMath.ceil(input), expected); --- 23,37 ---- /* * @test * @bug 6908131 * @summary Check for correct implementation of Math.ceil and Math.floor + * @library /lib/testlibrary + * @build jdk.testlibrary.DoubleUtils jdk.testlibrary.FloatUtils + * @run main CeilAndFloorTests */ public class CeilAndFloorTests { private static int testCeilCase(double input, double expected) { int failures = 0; failures += Tests.test("Math.ceil", input, Math.ceil(input), expected); failures += Tests.test("StrictMath.ceil", input, StrictMath.ceil(input), expected);
*** 137,150 **** public static int roundingTests() { int failures = 0; double [][] testCases = { { Double.MIN_VALUE, 1.0}, {-Double.MIN_VALUE, -0.0}, ! { Math.nextDown(DoubleConsts.MIN_NORMAL), 1.0}, ! {-Math.nextDown(DoubleConsts.MIN_NORMAL), -0.0}, ! { DoubleConsts.MIN_NORMAL, 1.0}, ! {-DoubleConsts.MIN_NORMAL, -0.0}, { 0.1, 1.0}, {-0.1, -0.0}, { 0.5, 1.0}, --- 138,151 ---- public static int roundingTests() { int failures = 0; double [][] testCases = { { Double.MIN_VALUE, 1.0}, {-Double.MIN_VALUE, -0.0}, ! { Math.nextDown(Double.MIN_NORMAL), 1.0}, ! {-Math.nextDown(Double.MIN_NORMAL), -0.0}, ! { Double.MIN_NORMAL, 1.0}, ! {-Double.MIN_NORMAL, -0.0}, { 0.1, 1.0}, {-0.1, -0.0}, { 0.5, 1.0},