bug fix
This commit is contained in:
parent
e8c94739fa
commit
55afed209b
|
@ -23,15 +23,14 @@ function getPrimeNumber($order){
|
||||||
|
|
||||||
while (count($primeNumbersList) < $order){
|
while (count($primeNumbersList) < $order){
|
||||||
$isPrimaryNumber=true;
|
$isPrimaryNumber=true;
|
||||||
foreach($primeNumbersList as $pr){
|
$index=0;
|
||||||
|
|
||||||
if($pr>sqrt($i)){
|
while(($primeNumbersList[$index]<=sqrt($i)) && $index < count($primeNumbersList)){
|
||||||
break;
|
if(fmod($i,$primeNumbersList[$index])==0){
|
||||||
}
|
|
||||||
if(fmod($i,$pr)==0){
|
|
||||||
$isPrimaryNumber=false;
|
$isPrimaryNumber=false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$index++;
|
||||||
}
|
}
|
||||||
if($isPrimaryNumber){
|
if($isPrimaryNumber){
|
||||||
$primeNumbersList[]=$i;
|
$primeNumbersList[]=$i;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user