mirror of
https://bitbucket.org/Mattrixwv/typescriptclasses.git
synced 2025-12-06 18:33:59 -05:00
Added test for isPrime function
This commit is contained in:
@@ -327,7 +327,7 @@ export function isPrime(possiblePrime: number): boolean{
|
||||
else if(((possiblePrime % 2) == 0) || ((possiblePrime % 3) == 0)){
|
||||
return false;
|
||||
}
|
||||
for(let cnt: number = 5;(cnt * cnt) <= possiblePrime; cnt += 6){
|
||||
for(let cnt: number = 5;(cnt * cnt) <= possiblePrime;cnt += 6){
|
||||
if(((possiblePrime % cnt) == 0) || ((possiblePrime % (cnt + 2)) == 0)){
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user