mirror of
https://bitbucket.org/Mattrixwv/my-classes.git
synced 2025-12-06 18:23:57 -05:00
Fixed another bug in the getDivisors function
This commit is contained in:
@@ -221,6 +221,10 @@ std::vector<T> getDivisors(T num){
|
||||
if(possibleDivisor != topPossibleDivisor){
|
||||
divisors.push_back(num / possibleDivisor);
|
||||
}
|
||||
//Take care of a few occations where a number was added twice
|
||||
if(divisors.at(divisors.size() - 1) == (possibleDivisor + 1)){
|
||||
++possibleDivisor;
|
||||
}
|
||||
}
|
||||
}
|
||||
//Sort the vector for neatness
|
||||
|
||||
Reference in New Issue
Block a user