Handle zero correctly.
authorNeil Booth <neil@daikokuya.co.uk>
Wed, 5 Dec 2007 13:01:24 +0000 (13:01 +0000)
committerNeil Booth <neil@daikokuya.co.uk>
Wed, 5 Dec 2007 13:01:24 +0000 (13:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44613 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/APFloat.cpp

index d713223a1e10600dbd02ae40ef1827f2d98717dc..f0707fc442e43efdbbbcea0dc98d7147db142e6c 100644 (file)
@@ -231,8 +231,8 @@ namespace {
      is taken to have the decimal point after a single leading
      non-zero digit.
 
-     If the value is zero, V->firstSigDigit points to a zero, and the
-     return exponent is zero.
+     If the value is zero, V->firstSigDigit points to a non-digit, and
+     the return exponent is zero.
   */
   struct decimalInfo {
     const char *firstSigDigit;
@@ -263,7 +263,7 @@ namespace {
     }
 
     /* If number is all zerooes accept any exponent.  */
-    if (p != D->firstSigDigit) {
+    if (decDigitValue(*p) >= 10U) {
       if (*p == 'e' || *p == 'E')
         D->exponent = readExponent(p + 1);