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 crash when exp(0) of p-adic numbers is called #39479

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Noel-Roemmele
Copy link
Contributor

Fixes #38037. Fixes crash when exp(0) is called when using p-adic numbers. Since the unit part of 0 does not exist it was causing a crash. Therefore, to fix this bug we check if our exponent is exactly 0 and if it is return 1 immediately. Also added a doctest to verify that the issue has been fixed.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

@DaveWitteMorris
Copy link
Member

LGTM. I will set to positive review on Wednesday if there are no other comments and make ptestlong (or CI testing) shows no problems.

@DaveWitteMorris
Copy link
Member

Oh, I missed this -- you do need to make one minor fix: There should only be one colon at the end of TESTS::, so you need to delete one of them. (Two colons are used when the following block is a code block, but you have a text comment before the code block.)

@DaveWitteMorris
Copy link
Member

make ptestlong came back ok, so you should just need to delete the extra colon mentioned above.

@DaveWitteMorris
Copy link
Member

Sorry, you need to make another minor correction in line 2964: change :trac: to :issue:.

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

Successfully merging this pull request may close these issues.

exp(0) does not work in p-adic extension
2 participants