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

Fixed a bug in primetest.py -> is_gaussian_prime #20912

Merged
merged 1 commit into from Feb 5, 2021

Conversation

techiepriyansh
Copy link
Contributor

@techiepriyansh techiepriyansh commented Feb 5, 2021

Changes

Changed the invocation of as_int function to use the flag strict=False in the function is_gaussian_prime of sympy.ntheory module in order to fix the following bug.

The bug:

Using the standard python "complex" library to do
sympy.ntheory.is_gaussian_prime(1+1j)
results in ValueError which is caused due to the usage of the default strict=True flag while invoking the as_int function.

Resolution:

Override the default strict=True flag to use strict=False while invoking the as_int function.

  • ntheory
    • Fixed a bug in the is_gaussian_prime function for python complex numbers (e.g. 1+1j).

The bug:
Using the standard python "complex" library to do 
sympy.ntheory.is_gaussian_prime(1+1j)
results in ValueError which is caused due to the usage of the default strict=True flag while invoking the as_int function.
Resolution:
Override the default strict=True flag to use strict=False while invoking the as_int function.
@sympy-bot
Copy link

sympy-bot commented Feb 5, 2021

Hi, I am the SymPy bot (v161). 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
    • Fixed a bug in the is_gaussian_prime function for python complex numbers (e.g. 1+1j). (#20912 by @techiepriyansh)

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

Click here to see the pull request description that was parsed.
### Changes
Changed the invocation of `as_int` function to use the flag `strict=False` in the function `is_gaussian_prime` of `sympy.ntheory` module in order to fix the following bug.

#### The bug:
Using the standard python "complex" library to do 
`sympy.ntheory.is_gaussian_prime(1+1j)`
results in `ValueError` which is caused due to the usage of the default `strict=True` flag while invoking the `as_int` function.
#### Resolution:
Override the default `strict=True` flag to use `strict=False` while invoking the `as_int` function.

<!-- BEGIN RELEASE NOTES -->
* ntheory
  * Fixed a bug in the `is_gaussian_prime` function for python complex numbers (e.g. `1+1j`).

<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@sylee957 sylee957 merged commit 82298df into sympy:master Feb 5, 2021
@techiepriyansh techiepriyansh deleted the patch-1 branch February 11, 2021 15:20
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.

None yet

4 participants