diff --git a/src/libraries/System.Private.CoreLib/src/System/Number.BigInteger.cs b/src/libraries/System.Private.CoreLib/src/System/Number.BigInteger.cs index c0b45828edfbb7..c19e7d036b04b3 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Number.BigInteger.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Number.BigInteger.cs @@ -602,6 +602,11 @@ public static void DivRem(ref BigInteger lhs, ref BigInteger rhs, out BigInteger { remLength--; } + else + { + // As soon as we find a non-zero block, the rest of remainder is significant + break; + } } rem._length = remLength;