test/sun/misc/FloatingDecimal/OldFloatingDecimalForTest.java

Print this page

        

@@ -21,12 +21,10 @@
  * questions.
  */
 
 //package sun.misc;
 
-import sun.misc.DoubleConsts;
-import sun.misc.FloatConsts;
 import java.util.regex.*;
 
 public class OldFloatingDecimalForTest{
     boolean     isExceptional;
     boolean     isNegative;

@@ -2215,16 +2213,16 @@
             // correct as false.
 
 
             // Check for overflow and update exponent accordingly.
 
-            if (exponent > DoubleConsts.MAX_EXPONENT) {         // Infinite result
+            if (exponent > Double.MAX_EXPONENT) {         // Infinite result
                 // overflow to properly signed infinity
                 return new OldFloatingDecimalForTest(sign * Double.POSITIVE_INFINITY);
             } else {  // Finite return value
-                if (exponent <= DoubleConsts.MAX_EXPONENT && // (Usually) normal result
-                    exponent >= DoubleConsts.MIN_EXPONENT) {
+                if (exponent <= Double.MAX_EXPONENT && // (Usually) normal result
+                    exponent >= Double.MIN_EXPONENT) {
 
                     // The result returned in this block cannot be a
                     // zero or subnormal; however after the
                     // significand is adjusted from rounding, we could
                     // still overflow in infinity.

@@ -2240,11 +2238,11 @@
                                      (DoubleConsts.SIGNIFICAND_WIDTH-1))
                                    & DoubleConsts.EXP_BIT_MASK) |
                         (DoubleConsts.SIGNIF_BIT_MASK & significand);
 
                 }  else  {  // Subnormal or zero
-                    // (exponent < DoubleConsts.MIN_EXPONENT)
+                    // (exponent < Double.MIN_EXPONENT)
 
                     if (exponent < (DoubleConsts.MIN_SUB_EXPONENT -1 )) {
                         // No way to round back to nonzero value
                         // regardless of significand if the exponent is
                         // less than -1075.

@@ -2280,11 +2278,11 @@
                         }
 
                         // Now, discard the bits
                         significand = significand >> bitsDiscarded;
 
-                        significand = (( ((long)(DoubleConsts.MIN_EXPONENT -1) + // subnorm exp.
+                        significand = (( ((long)(Double.MIN_EXPONENT -1) + // subnorm exp.
                                           (long)DoubleConsts.EXP_BIAS) <<
                                          (DoubleConsts.SIGNIFICAND_WIDTH-1))
                                        & DoubleConsts.EXP_BIT_MASK) |
                             (DoubleConsts.SIGNIF_BIT_MASK & significand);
                     }

@@ -2348,11 +2346,11 @@
                  * value with that exponent can round up to the
                  * minimum subnormal value and the sticky bit
                  * information must be preserved (i.e. case 1).
                  */
                 if ((exponent >= FloatConsts.MIN_SUB_EXPONENT-1) &&
-                    (exponent <= FloatConsts.MAX_EXPONENT ) ){
+                    (exponent <= Float.MAX_EXPONENT ) ){
                     // Outside above exponent range, the float value
                     // will be zero or infinity.
 
                     /*
                      * If the low-order 28 bits of a rounded double