Skip to content

Commit 1c6a1df

Browse files
committed
Add Assert
1 parent e95bca0 commit 1c6a1df

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libraries/System.Runtime.Numerics/src/System/Numerics/BigIntegerCalculator.SquMul.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ internal const
2424
public static void Square(ReadOnlySpan<uint> value, Span<uint> bits)
2525
{
2626
Debug.Assert(bits.Length == value.Length + value.Length);
27+
Debug.Assert(!bits.ContainsAnyExcept(0u));
2728

2829
// Executes different algorithms for computing z = a * a
2930
// based on the actual length of a. If a is "small" enough
@@ -210,6 +211,8 @@ public static void Multiply(ReadOnlySpan<uint> left, uint right, Span<uint> bits
210211
[MethodImpl(MethodImplOptions.AggressiveInlining)]
211212
public static void Multiply(ReadOnlySpan<uint> left, ReadOnlySpan<uint> right, Span<uint> bits)
212213
{
214+
Debug.Assert(!bits.ContainsAnyExcept(0u));
215+
213216
if (left.Length < right.Length)
214217
{
215218
if (left.Length > 0)

0 commit comments

Comments
 (0)