test/java/lang/Math/Log1pTests.java
Print this page
@@ -23,14 +23,17 @@
/*
* @test
* @bug 4851638 4939441
* @summary Tests for {Math, StrictMath}.log1p
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.DoubleUtils jdk.testlibrary.FloatUtils
+ * @run main Log1pTests
* @author Joseph D. Darcy
*/
-import sun.misc.DoubleConsts;
+import static jdk.testlibrary.DoubleUtils.*;
public class Log1pTests {
private Log1pTests(){}
static final double infinityD = Double.POSITIVE_INFINITY;
@@ -84,18 +87,18 @@
failures += testLog1pCaseWithUlpDiff(testCases[i][0],
testCases[i][1], 0);
}
// For |x| < 2^-54 log1p(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 += testLog1pCase(d, d);
failures += testLog1pCase(-d, -d);
}
// For x > 2^53 log1p(x) ~= log(x)
- for(int i = 53; i <= DoubleConsts.MAX_EXPONENT; i++) {
+ for(int i = 53; i <= Double.MAX_EXPONENT; i++) {
double d = Math.scalb(2, i);
failures += testLog1pCaseWithUlpDiff(d, StrictMath.log(d), 2.001);
}
// Construct random values with exponents ranging from -53 to