diff --git a/Algorithms.hpp b/Algorithms.hpp index a62163c..38090f0 100644 --- a/Algorithms.hpp +++ b/Algorithms.hpp @@ -175,15 +175,15 @@ std::vector getNumPrimes(T numberOfPrimes){ //This function determines whether the number passed into it is a prime template -bool isPrime(T num){ - if(num <= 3){ - return num > 1; +bool isPrime(T possiblePrime){ + if(possiblePrime <= 3){ + return possiblePrime > 1; } - else if(((num % 2) == 0) || ((num % 3) == 0)){ + else if(((possiblePrime % 2) == 0) || ((possiblePrime % 3) == 0)){ return false; } - for(T cnt = 5;(cnt * cnt) <= num;cnt += 6){ - if(((num % cnt) == 0) || ((num % (cnt + 2)) == 0)){ + for(T cnt = 5;(cnt * cnt) <= possiblePrime;cnt += 6){ + if(((possiblePrime % cnt) == 0) || ((possiblePrime % (cnt + 2)) == 0)){ return false; } }