Protection against integer overflow added

This commit is contained in:
Marek Lemańczyk committed 2025-09-10 19:52:46 +02:00
1 parent 4be525520f
commit 95fa143ac3
1 file changed
+1 -1
+1 -1
View File
@@ -64,7 +64,7 @@ public static class PrimesGenerator
if (isPrime)
{
primes[primeIndex] = i;
primesPow2[primeIndex] = checked(i * i);
primesPow2[primeIndex] = checked((ulong)i * i);
primeIndex++;
}
}