-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Description
In the algorithm for the Miller-Rabin primality test, 0 is reported as a prime. 0 should be special-cased by an initial "if 0 return false;" check. One can argue 0 is just invalid input for the algorithm, but I would then argue at least throwing an assert error on 0 input is preferable so it becomes clear to anyone reading or potentially copying the algorithm for primality testing that 0 is not a prime but not accounted for in the current algorithm logic.
Metadata
Metadata
Assignees
Labels
No labels