[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
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

Update primetest.py fixing Miller-Rabin for even numbers #27146

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ddcvb1
Copy link
@ddcvb1 ddcvb1 commented Oct 8, 2024

Update primetest.py fixing Miller-Rabin for even numbers

References to other Issues or PRs

Fixes #27145

Brief description of what is fixed or changed

inside of primetest.py I added in addition to the preexisting check to make sure that numbers put through the Miller-Rabin function were less than 2, that they also were not divisible by two in order to remove all even numbers from the equation fixing the false positives created when running the function with even numbers such as 90.

Other comments

Release Notes

  • ntheory
    • fixed the functionality of the Miller-Rabin (mr) function.

@sympy-bot
Copy link
sympy-bot commented Oct 8, 2024

Hi, I am the SymPy bot. I'm here to help you write a release notes entry. Please read the guide on how to write release notes.

Your release notes are in good order.

Here is what the release notes will look like:

  • ntheory

This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.14.

Click here to see the pull request description that was parsed.
Update primetest.py fixing Miller-Rabin for even numbers
#### References to other Issues or PRs
Fixes #27145 
#### Brief description of what is fixed or changed
inside of primetest.py I added in addition to the preexisting check to make sure that numbers put through the Miller-Rabin function were less than 2, that they also were not divisible by two in order to remove all even numbers from the equation fixing the false positives created when running the function with even numbers such as 90.
#### Other comments
#### Release Notes
<!-- BEGIN RELEASE NOTES -->
* ntheory
  * fixed the functionality of the Miller-Rabin (mr) function.
<!-- END RELEASE NOTES -->

@@ -76,6 +76,7 @@ def test_is_extra_strong_lucas_prp():

@slow
def test_prps():
assert [mr(i) for i in (1, 2, 4)] == [False, True, False]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test fails because it does not pass the second argument to mr.

@oscarbenjamin
Copy link
Collaborator

You'll need to add yourself to the .mailmap file:
https://docs.sympy.org/dev/contributing/new-contributors-guide/workflow-process.html#mailmap-instructions

A line like this needs to be added:

Your Name <email@adress.com> ddcvb1 <64090159+ddcvb1@users.noreply.github.com>

Then run bin/mailmap_check.py to reorder the file.

@oscarbenjamin oscarbenjamin marked this pull request as draft October 19, 2024 17:24
@oscarbenjamin
Copy link
Collaborator

I'm marking this as draft. Feel free to mark it as ready for review after the review comments above are addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Miller-Rabin implementation doesn't check for odd numbers
4 participants