mirror of
https://bitbucket.org/Mattrixwv/octavefunctions.git
synced 2025-12-07 03:03:57 -05:00
Updated to fix infinite loop and time
This commit is contained in:
@@ -17,6 +17,7 @@ while(~found)
|
||||
if(mod(numSum, divCounter) == 0)
|
||||
numDivisors += 2;
|
||||
end
|
||||
++divCounter;
|
||||
end
|
||||
|
||||
%Check if there are enough divisors
|
||||
@@ -33,7 +34,7 @@ endTime = clock();
|
||||
number = numSum
|
||||
highestNumber = counter - 1
|
||||
numDivisors = numDivisors
|
||||
totalTime = etime(endTime - startTime)
|
||||
totalTime = etime(endTime, startTime)
|
||||
|
||||
%Cleanup the variables
|
||||
clear found;
|
||||
@@ -46,3 +47,4 @@ clear endTime;
|
||||
clear totalTime;
|
||||
clear numDivisors;
|
||||
clear divCounter;
|
||||
clear ans;
|
||||
|
||||
Reference in New Issue
Block a user