-
-
Notifications
You must be signed in to change notification settings - Fork 523
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
Change behavior of algebraic reals with respect to fractional powers #38564
base: develop
Are you sure you want to change the base?
Conversation
Documentation preview for this PR (built with commit 541c338; changes) is ready! 🎉 |
As I explained in sage-devel, I don't think the behaviour of |
The issue is not mathematical correctness. Any cube root of -1 is a mathematically correct answer to AA(-1)^(1/3). Currently, for a parent P, P(-1)^(1/3) gives the principal root of -1 for all parents P, with a unique exception AA. This inconsistency causes confusion. Fortunately, P(x).nth_root(3) may be used when a cube root in P is expected. In the same vein, I think it is a "bug" if P(-1).nth_root(n) gives an answer not in P. Currently RR(-1).nth_root(4) correctly raises an exception. But AA(-1).nth_root(4) silently gives the principal root of -1. One may hope to "fix" this. This PR won't. If you are still not convinced, please put forth your objection in #38362 when that PR is ready to be merged. |
We fix two inconsistent behaviors of algebraic reals:
(1)
See the discussion: https://groups.google.com/g/sage-devel/c/s81ieq2vpVo
(2)
With this PR,
These behavior changes fix #12745, #36735.
On the other hand, the behavior of
AA(x).nth_root(n)
does not change, and gives an n-th root inAA
.📝 Checklist
⌛ Dependencies