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
db62b76ec2
commit
1705425690
@ -18,7 +18,7 @@ function isPrime(int $number)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$i = 3;
|
$i = 3;
|
||||||
while ($i < sqrt($number)) {
|
while ($i <= sqrt($number)) {
|
||||||
if ($number % $i === 0) {
|
if ($number % $i === 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user