Skip to content

Fixed crash when exp(0) of p-adic numbers is called #39479

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

Merged
merged 4 commits into from
Feb 21, 2025

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:.

Copy link

Documentation preview for this PR (built with commit 56b0fc4; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@vbraun vbraun merged commit 8e204dd into sagemath:develop Feb 21, 2025
22 checks passed
@Noel-Roemmele Noel-Roemmele deleted the 38037Exp0Padic branch February 23, 2025 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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