Protection against integer overflow added
This commit is contained in:
1 parent
4be525520f
commit
95fa143ac3
1 file changed
+1
-1
@@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user