-
-
Save mike-huls/5347b9e2cd339934857061db39d6abc9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cpdef int evalcount(int range_from, int range_til): | |
""" Returns the number of evaluations that need to be performed when finding prime numbers in the given range range""" | |
cdef int evalcount = 0 | |
cdef int num | |
cdef int candidate_prime | |
for num in range(range_from, range_til + 1): | |
if (num > 1): | |
for divnum in range(2, num): | |
evalcount += 1 | |
if ((num % divnum) == 0): | |
break | |
return evalcount |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment