mirror of
https://bitbucket.org/Mattrixwv/luaclasses.git
synced 2025-12-06 10:23:58 -05:00
Fixed possible bug
This commit is contained in:
@@ -126,7 +126,7 @@ function isPrime(possiblePrime)
|
||||
elseif(((possiblePrime % 2) == 0) or ((possiblePrime % 3) == 0)) then
|
||||
return false;
|
||||
end
|
||||
for cnt = 5, math.sqrt(possiblePrime), 6 do
|
||||
for cnt = 5, math.sqrt(possiblePrime) + 1, 6 do
|
||||
if(((possiblePrime % cnt) == 0) or ((possiblePrime % (cnt + 2)) == 0)) then
|
||||
return false;
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user