7039369: Limit range of strictfp in FloatingDecimal
authordarcy
Tue, 26 Apr 2011 10:35:06 -0700
changeset 9521 e18f95eadb3c
parent 9520 99d378796e54
child 9522 38e96027251b
child 9526 a80328f995f1
child 9531 f5746de94029
7039369: Limit range of strictfp in FloatingDecimal Summary: Additional reviews by sergey.kuksenko@oracle.com Reviewed-by: alanb
jdk/src/share/classes/sun/misc/FloatingDecimal.java
jdk/src/share/classes/sun/misc/FormattedFloatingDecimal.java
jdk/test/java/lang/Double/ParseDouble.java
--- a/jdk/src/share/classes/sun/misc/FloatingDecimal.java	Tue Apr 26 12:49:34 2011 +0200
+++ b/jdk/src/share/classes/sun/misc/FloatingDecimal.java	Tue Apr 26 10:35:06 2011 -0700
@@ -30,7 +30,7 @@
 import sun.misc.FloatConsts;
 import java.util.regex.*;
 
-public strictfp class FloatingDecimal{
+public class FloatingDecimal{
     boolean     isExceptional;
     boolean     isNegative;
     int         decExponent;
@@ -239,8 +239,7 @@
      * More difficult if subtracting and the argument
      * is a normalized a power of 2, as the ULP changes at these points.
      */
-    private static double
-    ulp( double dval, boolean subtracting ){
+    private static double ulp( double dval, boolean subtracting ){
         long lbits = Double.doubleToLongBits( dval ) & ~signMask;
         int binexp = (int)(lbits >>> expShift);
         double ulpval;
@@ -1251,8 +1250,7 @@
      * for a single-precision float.
      */
 
-    public double
-    doubleValue(){
+    public strictfp double doubleValue(){
         int     kDigits = Math.min( nDigits, maxDecimalDigits+1 );
         long    lValue;
         double  dValue;
@@ -1611,8 +1609,7 @@
      * ( because of the preference to a zero low-order bit ).
      */
 
-    public float
-        floatValue(){
+    public strictfp float floatValue(){
         int     kDigits = Math.min( nDigits, singleMaxDecimalDigits+1 );
         int     iValue;
         float   fValue;
--- a/jdk/src/share/classes/sun/misc/FormattedFloatingDecimal.java	Tue Apr 26 12:49:34 2011 +0200
+++ b/jdk/src/share/classes/sun/misc/FormattedFloatingDecimal.java	Tue Apr 26 10:35:06 2011 -0700
@@ -30,7 +30,7 @@
 import sun.misc.FloatConsts;
 import java.util.regex.*;
 
-public strictfp class FormattedFloatingDecimal{
+public class FormattedFloatingDecimal{
     boolean     isExceptional;
     boolean     isNegative;
     int         decExponent;  // value set at construction, then immutable
@@ -247,8 +247,7 @@
      * More difficult if subtracting and the argument
      * is a normalized a power of 2, as the ULP changes at these points.
      */
-    private static double
-    ulp( double dval, boolean subtracting ){
+    private static double ulp( double dval, boolean subtracting ){
         long lbits = Double.doubleToLongBits( dval ) & ~signMask;
         int binexp = (int)(lbits >>> expShift);
         double ulpval;
@@ -1157,8 +1156,7 @@
      * for a single-precision float.
      */
 
-    public double
-    doubleValue(){
+    public strictfp double doubleValue(){
         int     kDigits = Math.min( nDigits, maxDecimalDigits+1 );
         long    lValue;
         double  dValue;
@@ -1517,8 +1515,7 @@
      * ( because of the preference to a zero low-order bit ).
      */
 
-    public float
-        floatValue(){
+    public strictfp float floatValue(){
         int     kDigits = Math.min( nDigits, singleMaxDecimalDigits+1 );
         int     iValue;
         float   fValue;
--- a/jdk/test/java/lang/Double/ParseDouble.java	Tue Apr 26 12:49:34 2011 +0200
+++ b/jdk/test/java/lang/Double/ParseDouble.java	Tue Apr 26 10:35:06 2011 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 4160406 4705734 4707389 4826774 4895911 4421494 7021568
+ * @bug 4160406 4705734 4707389 4826774 4895911 4421494 7021568 7039369
  * @summary Test for Double.parseDouble method and acceptance regex
  */