test/java/lang/Math/Expm1Tests.java

Print this page

        

@@ -23,14 +23,17 @@
 
 /*
  * @test
  * @bug 4851638 4900189 4939441
  * @summary Tests for {Math, StrictMath}.expm1
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.DoubleUtils jdk.testlibrary.FloatUtils
+ * @run main Expm1Tests
  * @author Joseph D. Darcy
  */
 
-import sun.misc.DoubleConsts;
+import static jdk.testlibrary.DoubleUtils.*;
 
 /*
  * The Taylor expansion of expxm1(x) = exp(x) -1 is
  *
  * 1 + x/1! + x^2/2! + x^3/3| + ... -1 =

@@ -78,11 +81,11 @@
                                                  testCases[i][1], 0, null);
         }
 
 
         // For |x| < 2^-54 expm1(x) ~= x
-        for(int i = DoubleConsts.MIN_SUB_EXPONENT; i <= -54; i++) {
+        for(int i = MIN_SUB_EXPONENT; i <= -54; i++) {
             double d = Math.scalb(2, i);
             failures += testExpm1Case(d, d);
             failures += testExpm1Case(-d, -d);
         }
 

@@ -97,11 +100,11 @@
         for(double d = 37.5; d <= 709.5; d += 1.0) {
             failures += testExpm1CaseWithUlpDiff(d, StrictMath.exp(d), 2, null);
         }
 
         // For x > 710, expm1(x) should be infinity
-        for(int i = 10; i <= DoubleConsts.MAX_EXPONENT; i++) {
+        for(int i = 10; i <= Double.MAX_EXPONENT; i++) {
             double d = Math.scalb(2, i);
             failures += testExpm1Case(d, infinityD);
         }
 
         // By monotonicity, once the limit is reached, the

@@ -114,11 +117,11 @@
         for(double d = -36.75; d >= -127.75; d -= 1.0) {
             failures += testExpm1CaseWithUlpDiff(d, -1.0, 1,
                                                  reachedLimit);
         }
 
-        for(int i = 7; i <= DoubleConsts.MAX_EXPONENT; i++) {
+        for(int i = 7; i <= Double.MAX_EXPONENT; i++) {
             double d = -Math.scalb(2, i);
             failures += testExpm1CaseWithUlpDiff(d, -1.0, 1, reachedLimit);
         }
 
         // Test for monotonicity failures near multiples of log(2).