You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2007/03/27 12:12:20 UTC

svn commit: r522857 - /xerces/c/branches/xerces-2.7/src/xercesc/util/XMLBigDecimal.cpp

Author: amassari
Date: Tue Mar 27 03:12:19 2007
New Revision: 522857

URL: http://svn.apache.org/viewvc?view=rev&rev=522857
Log:
A decimal value of 0.0 was treated as a positive number, so it was different from 0

Modified:
    xerces/c/branches/xerces-2.7/src/xercesc/util/XMLBigDecimal.cpp

Modified: xerces/c/branches/xerces-2.7/src/xercesc/util/XMLBigDecimal.cpp
URL: http://svn.apache.org/viewvc/xerces/c/branches/xerces-2.7/src/xercesc/util/XMLBigDecimal.cpp?view=diff&rev=522857&r1=522856&r2=522857
==============================================================================
--- xerces/c/branches/xerces-2.7/src/xercesc/util/XMLBigDecimal.cpp (original)
+++ xerces/c/branches/xerces-2.7/src/xercesc/util/XMLBigDecimal.cpp Tue Mar 27 03:12:19 2007
@@ -288,7 +288,7 @@
     /***
     E2-44 totalDigits
 
-     ... by restricting it to numbers that are expressible as i × 10^-n
+     ... by restricting it to numbers that are expressible as i x 10^-n
      where i and n are integers such that |i| < 10^totalDigits and 0 <= n <= totalDigits. 
 
         normalization: remove all trailing zero after the '.'
@@ -300,6 +300,9 @@
         fractDigits--;
         totalDigits--;
     }
+    // 0.0 got past the check for zero because of the decimal point, so we need to double check it here
+    if(totalDigits==0)
+        sign = 0;
 
     *retPtr = chNull;   //terminated
     return;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org