diff --git a/src/libraries/System.Private.CoreLib/src/System/Number.NumberToFloatingPointBits.cs b/src/libraries/System.Private.CoreLib/src/System/Number.NumberToFloatingPointBits.cs index 3443622b3f8fe6..98ad9f25fcd463 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Number.NumberToFloatingPointBits.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Number.NumberToFloatingPointBits.cs @@ -484,7 +484,16 @@ private static ulong NumberToFloatingPointBitsSlow(ref NumberBuffer number, in F } 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);