Adjusted variable names

This commit is contained in:
2020-10-30 16:05:12 -04:00
parent a1e0d53e8d
commit 0266785921

View File

@@ -175,15 +175,15 @@ std::vector<T> getNumPrimes(T numberOfPrimes){
//This function determines whether the number passed into it is a prime
template <class T>
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;
}
}