Check for overflow when calculating pow 2
This commit is contained in:
1 parent
366ac6edb5
commit
60f6952f91
1 file changed
+1
-1
@@ -64,7 +64,7 @@ public static class PrimesGenerator
|
||||
if (isPrime)
|
||||
{
|
||||
primes[primeIndex] = i;
|
||||
primesPow2[primeIndex] = i * i;
|
||||
primesPow2[primeIndex] = checked(i * i);
|
||||
primeIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user