harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhouke...@apache.org
Subject svn commit: r806424 - in /harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared: dblparse.c fltparse.c
Date Fri, 21 Aug 2009 05:41:24 GMT
Author: zhoukevin
Date: Fri Aug 21 05:41:24 2009
New Revision: 806424

URL: http://svn.apache.org/viewvc?rev=806424&view=rev
Log:
On zOS, pow(10.0, int) always incorrectly returns 1.0000~, we should cast the 2nd parameter
int to double type.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/dblparse.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/fltparse.c

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/dblparse.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/dblparse.c?rev=806424&r1=806423&r2=806424&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/dblparse.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/dblparse.c Fri
Aug 21 05:41:24 2009
@@ -293,7 +293,7 @@
     }
   else if (e >= 0 && e < APPROX_MAX_MAGNITUDE)
     {
-      result = toDoubleHighPrecision (f, length) * pow (10.0, e);
+      result = toDoubleHighPrecision (f, length) * pow (10.0, (double) e);
     }
   else if (e >= APPROX_MAX_MAGNITUDE)
     {
@@ -313,14 +313,14 @@
     }
   else if (e > APPROX_MIN_MAGNITUDE)
     {
-      result = toDoubleHighPrecision (f, length) / pow (10.0, -e);
+      result = toDoubleHighPrecision (f, length) / pow (10.0, (double) -e);
     }
 
   if (e <= APPROX_MIN_MAGNITUDE)
     {
 
-      result = toDoubleHighPrecision (f, length) * pow (10.0, e + 52);
-      result = result * pow (10.0, -52);
+      result = toDoubleHighPrecision (f, length) * pow (10.0, (double) (e + 52));
+      result = result * pow (10.0, (double) -52);
 
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/fltparse.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/fltparse.c?rev=806424&r1=806423&r2=806424&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/fltparse.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/fltparse.c Fri
Aug 21 05:41:24 2009
@@ -231,7 +231,7 @@
     }
   else if (e >= 0 && e < 39)
     {
-      result = (jfloat) (toDoubleHighPrecision (f, length) * pow (10.0, e));
+      result = (jfloat) (toDoubleHighPrecision (f, length) * pow (10.0, (double) e));
     }
   else if (e >= 39)
     {
@@ -251,7 +251,7 @@
       int dexp;
       U_32 fmant, fovfl;
       U_64 dmant;
-      dresult = toDoubleHighPrecision (f, length) / pow (10.0, -e);
+      dresult = toDoubleHighPrecision (f, length) / pow (10.0, (double) -e);
       if (IS_DENORMAL_DBL (dresult))
         {
           FLOAT_TO_INTBITS (result) = 0;



Mime
View raw message