test/java/lang/Math/IeeeRecommendedTests.java
Print this page
@@ -175,11 +175,11 @@
failures += testGetExponentCase(randFloat, i);
}
if (i > FloatConsts.MIN_EXPONENT) {
- float po2minus = FpUtils.nextAfter(po2,
+ float po2minus = Math.nextAfter(po2,
Float.NEGATIVE_INFINITY);
failures += testGetExponentCase(po2minus, i-1);
}
}
@@ -203,11 +203,11 @@
FloatConsts.MIN_EXPONENT - 1);
// Test largest value in next smaller binade
if (i >= 3) {// (i == 1) would test 0.0;
// (i == 2) would just retest MIN_VALUE
- testGetExponentCase(FpUtils.nextAfter(top, 0.0f),
+ testGetExponentCase(Math.nextAfter(top, 0.0f),
FloatConsts.MIN_EXPONENT - 1);
if( i >= 10) {
// create a bit mask with (i-1) 1's in the low order
// bits
@@ -282,11 +282,11 @@
failures += testGetExponentCase(randFloat, i);
}
if (i > DoubleConsts.MIN_EXPONENT) {
- double po2minus = FpUtils.nextAfter(po2,
+ double po2minus = Math.nextAfter(po2,
Double.NEGATIVE_INFINITY);
failures += testGetExponentCase(po2minus, i-1);
}
}
@@ -310,11 +310,11 @@
DoubleConsts.MIN_EXPONENT - 1);
// Test largest value in next smaller binade
if (i >= 3) {// (i == 1) would test 0.0;
// (i == 2) would just retest MIN_VALUE
- testGetExponentCase(FpUtils.nextAfter(top, 0.0),
+ testGetExponentCase(Math.nextAfter(top, 0.0),
DoubleConsts.MIN_EXPONENT - 1);
if( i >= 10) {
// create a bit mask with (i-1) 1's in the low order
// bits
@@ -1059,11 +1059,11 @@
int scaleFactor = manyScalingFactors[j];
if (Math.abs(scaleFactor) >= MAX_SCALE) {
float value = someTestCases[i];
failures+=testScalbCase(value,
scaleFactor,
- FpUtils.copySign( (scaleFactor>0?infinityF:0.0f), value) );
+ Math.copySign( (scaleFactor>0?infinityF:0.0f), value) );
}
}
}
// Test cases that could be done with one floating-point
@@ -1093,11 +1093,11 @@
int scaleFactor = j;
failures+=testScalbCase(value,
scaleFactor,
(FpUtils.ilogb(value) +j > FloatConsts.MAX_EXPONENT ) ?
- FpUtils.copySign(infinityF, value) : // overflow
+ Math.copySign(infinityF, value) : // overflow
// calculate right answer
twoToTheMaxExp*(twoToTheMaxExp*(scale*value)) );
scale*=2.0f;
}
}
@@ -1266,11 +1266,11 @@
int scaleFactor = manyScalingFactors[j];
if (Math.abs(scaleFactor) >= MAX_SCALE) {
double value = someTestCases[i];
failures+=testScalbCase(value,
scaleFactor,
- FpUtils.copySign( (scaleFactor>0?infinityD:0.0), value) );
+ Math.copySign( (scaleFactor>0?infinityD:0.0), value) );
}
}
}
// Test cases that could be done with one floating-point
@@ -1300,11 +1300,11 @@
int scaleFactor = j;
failures+=testScalbCase(value,
scaleFactor,
(FpUtils.ilogb(value) +j > DoubleConsts.MAX_EXPONENT ) ?
- FpUtils.copySign(infinityD, value) : // overflow
+ Math.copySign(infinityD, value) : // overflow
// calculate right answer
twoToTheMaxExp*(twoToTheMaxExp*(scale*value)) );
scale*=2.0;
}
}
@@ -1421,11 +1421,11 @@
for(int i = FloatConsts.MIN_EXPONENT; i <= FloatConsts.MAX_EXPONENT; i++) {
float expected;
// Create power of two
float po2 = powerOfTwoF(i);
- expected = FpUtils.scalb(1.0f, i - (FloatConsts.SIGNIFICAND_WIDTH-1));
+ expected = Math.scalb(1.0f, i - (FloatConsts.SIGNIFICAND_WIDTH-1));
failures += testUlpCase(po2, expected);
// Generate some random bit patterns for the significand
for(int j = 0; j < 10; j++) {
@@ -1441,11 +1441,11 @@
failures += testUlpCase(randFloat, expected);
}
if (i > FloatConsts.MIN_EXPONENT) {
- float po2minus = FpUtils.nextAfter(po2,
+ float po2minus = Math.nextAfter(po2,
Float.NEGATIVE_INFINITY);
failures += testUlpCase(po2minus, expected/2.0f);
}
}
@@ -1468,11 +1468,11 @@
failures += testUlpCase(top, Float.MIN_VALUE);
// Test largest value in next smaller binade
if (i >= 3) {// (i == 1) would test 0.0;
// (i == 2) would just retest MIN_VALUE
- testUlpCase(FpUtils.nextAfter(top, 0.0f),
+ testUlpCase(Math.nextAfter(top, 0.0f),
Float.MIN_VALUE);
if( i >= 10) {
// create a bit mask with (i-1) 1's in the low order
// bits
@@ -1526,11 +1526,11 @@
for(int i = DoubleConsts.MIN_EXPONENT; i <= DoubleConsts.MAX_EXPONENT; i++) {
double expected;
// Create power of two
double po2 = powerOfTwoD(i);
- expected = FpUtils.scalb(1.0, i - (DoubleConsts.SIGNIFICAND_WIDTH-1));
+ expected = Math.scalb(1.0, i - (DoubleConsts.SIGNIFICAND_WIDTH-1));
failures += testUlpCase(po2, expected);
// Generate some random bit patterns for the significand
for(int j = 0; j < 10; j++) {
@@ -1546,11 +1546,11 @@
failures += testUlpCase(randDouble, expected);
}
if (i > DoubleConsts.MIN_EXPONENT) {
- double po2minus = FpUtils.nextAfter(po2,
+ double po2minus = Math.nextAfter(po2,
Double.NEGATIVE_INFINITY);
failures += testUlpCase(po2minus, expected/2.0f);
}
}
@@ -1573,11 +1573,11 @@
failures += testUlpCase(top, Double.MIN_VALUE);
// Test largest value in next smaller binade
if (i >= 3) {// (i == 1) would test 0.0;
// (i == 2) would just retest MIN_VALUE
- testUlpCase(FpUtils.nextAfter(top, 0.0f),
+ testUlpCase(Math.nextAfter(top, 0.0f),
Double.MIN_VALUE);
if( i >= 10) {
// create a bit mask with (i-1) 1's in the low order
// bits