Updated to run faster

This commit is contained in:
2018-09-27 13:33:27 -04:00
parent d44eb0b886
commit 7af5735451

View File

@@ -6,7 +6,6 @@
#include <iostream> #include <iostream>
#include <cmath> //For fmod
#include <chrono> //For the timer #include <chrono> //For the timer
@@ -50,7 +49,7 @@ unsigned long countDivisors(unsigned long number){
for(int cnt = 1;cnt * cnt < number;++cnt){ for(int cnt = 1;cnt * cnt < number;++cnt){
//Check if the counter evenly divides the number //Check if the counter evenly divides the number
//If it does the counter and the other number are both divisors //If it does the counter and the other number are both divisors
if(fmod((double)number, (double)cnt) == 0){ if((number % cnt) == 0){
numDivisors += 2; numDivisors += 2;
} }
} }