Updating NumberToFloatingPointBitsSlow to handle the remaining parsed fractional...
authorTanner Gooding <tagoo@outlook.com>
Thu, 7 Nov 2019 21:06:32 +0000 (13:06 -0800)
committerGitHub <noreply@github.com>
Thu, 7 Nov 2019 21:06:32 +0000 (13:06 -0800)
Commit migrated from https://github.com/dotnet/coreclr/commit/460b97aa406f10cf9ab19e6398e1e1a72fc58b48

src/libraries/System.Private.CoreLib/src/System/Number.NumberToFloatingPointBits.cs

index 3443622..98ad9f2 100644 (file)
@@ -484,7 +484,16 @@ namespace System
             }
 
             AccumulateDecimalDigitsIntoBigInteger(ref number, fractionalFirstIndex, fractionalLastIndex, out BigInteger fractionalNumerator);
-            Debug.Assert(!fractionalNumerator.IsZero());
+
+            if (fractionalNumerator.IsZero())
+            {
+                return ConvertBigIntegerToFloatingPointBits(
+                    ref integerValue,
+                    in info,
+                    integerBitsOfPrecision,
+                    fractionalDigitsPresent != 0
+                );
+            }
 
             BigInteger.Pow10(fractionalDenominatorExponent, out BigInteger fractionalDenominator);