mirror of
https://github.com/TheAlgorithms/PHP.git
synced 2025-01-17 15:18:13 +01:00
fix to bug in CheckPrime
This commit is contained in:
parent
dd70b86e62
commit
c469000cc0
@ -18,7 +18,7 @@ function isPrime(int $number)
|
||||
}
|
||||
|
||||
$i = 3;
|
||||
while ($i < sqrt($number)) {
|
||||
while ($i <= sqrt($number)) {
|
||||
if ($number % $i === 0) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user