-
Notifications
You must be signed in to change notification settings - Fork 32
Closed
Description
It seems like this could be fixed with a little refactoring. Instead of having witnesses(n) return a variably sized tuple (which is not type stable), it would be better to inline this into isprime and do something like:
return n < 4294967296 ? checkwitnesses(n, _witnesses(UInt64(n))) :
n < 2152302898747 ? checkwitnesses(n, (2, 3, 5, 7, 11)) :
n < 3474749660383 ? checkwitnesses(n, (2, 3, 5, 7, 11, 13)):
checkwitnesses(n, (2, 325, 9375, 28178, 450775, 9780504, 1795265022))where checkwitnesses(n, witnesses) is simply this loop refactored into a function.
Metadata
Metadata
Assignees
Labels
No labels