You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sagemathgh-39479: Fixed crash when exp(0) of p-adic numbers is called
Fixessagemath#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
<!-- Put an `x` in all the boxes that apply. -->
- [X] The title is concise and informative.
- [X] The description explains in detail what this PR is about.
- [X] I have linked a relevant issue or discussion.
- [X] I have created tests covering the changes.
- [X] I have updated the documentation and checked the documentation
preview.
### ⌛ Dependencies
URL: sagemath#39479
Reported by: Noel-Roemmele
Reviewer(s):
Uh oh!
There was an error while loading. Please reload this page.
Steps To Reproduce
Run the following three lines:
R.<a>=Zq(9,prec=5)
zero=R.zero()
exp(zero)
Expected Behavior
The number 1 in R (the same as R.one())
Actual Behavior
Sage gives an error:
ValueError: unit part of 0 not defined
Additional Information
No response
Environment
Checklist
The text was updated successfully, but these errors were encountered: