-
Notifications
You must be signed in to change notification settings - Fork 230
Miller rabin #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Miller rabin #13
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Apologies for my slowness: I moved and won't have consistent WiFi for a while. I'll give proper code reviews as soon as I can.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patience! I left some suggestions.
…lue for turtle and hare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I have either added or responded to all your suggestions, hope I didn't miss anything.
Also, I made the mod_inv and mod_exp functions private as you suggested, however, I think they are useful and I think people could benefit from them being public. If you do choose to keep them private, you can remove mod_inv as it currently has no uses in the code other than the test function. |
Thanks! I agree that they're useful. Right now, this code is essentially duplicated by |
I finally see what you mean. I avoided reading through |
I might rename Storing a separate MOD with each integer would double the memory footprint and add dynamic checks that the MODs match; I'd like to avoid that. One solution might be to implement |
Alright, I think I've addressed everything that was brought up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, looks good! Feel free to squash and merge.
Added modular exponentiation along with the miller rabin primality test. Tests included. Also added vscode workspace stuff to the .gitignore.