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
gh-36852: `failing doctest on Apple M1`: corrected the test case by sorting the result
<!-- ^^^^^ Please provide a concise, informative and self-explanatory
title. Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes#1234" use "Introduce new method to
calculate 1+1" --> <!-- Describe your changes here in detail -->
I have added `rts = sorted(rts, key=lambda x: (x.real(), x.imag()))`
after `rts = f.roots(ring=fld_out, multiplicities=False)` in
```
for (fld_in, fld_out) in flds:
x = polygen(fld_in)
f = x^3 - fld_in(2)
x2 = polygen(fld_out)
f2 = x2^3 - fld_out(2)
for algo in (None, 'pari', 'numpy'):
rts = f.roots(ring=fld_out, multiplicities=False)
if fld_in == fld_out and algo is None:
print("{} {}".format(fld_in, rts))
for rt in rts:
assert(abs(f2(rt)) <= 1e-10)
assert(rt.parent() == fld_out)
```
I have sorted the rts; first based on the real part of the complex
number and then based on the complex part.
I have also updated the test result by sorting them aswell.
This ensures that the output matches the test results, resulting in a
passing test.
<!-- Why is this change required? What problem does it solve? --> <!--
If this PR resolves an open issue, please link to it here. For example
"Fixes#12345". -->
Fixes#36850
<!-- If your change requires a documentation PR, please link it
appropriately. -->
### 📝 Checklist
<!-- Put an `x` in all the boxes that apply. --> <!-- If your change
requires a documentation PR, please link it appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! --> <!-- Feel free to remove irrelevant items. -->
- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion. <!-- If you're
unsure about any of these, don't hesitate to ask. We're here to help!
--> there where also many
URL: #36852
Reported by: Aman Moon
Reviewer(s): Dima Pasechnik
@@ -8113,9 +8114,9 @@ cdef class Polynomial(CommutativePolynomial):
8113
8114
Real Field with 53 bits of precision [1.25992104989487]
8114
8115
Real Double Field [1.25992104989...]
8115
8116
Real Field with 100 bits of precision [1.2599210498948731647672106073]
8116
-
Complex Field with 53 bits of precision [1.25992104989487, -0.62996052494743... - 1.09112363597172*I, -0.62996052494743... + 1.09112363597172*I]
8117
-
Complex Double Field [1.25992104989..., -0.629960524947... - 1.0911236359717...*I, -0.629960524947... + 1.0911236359717...*I]
8118
-
Complex Field with 100 bits of precision [1.2599210498948731647672106073, -0.62996052494743658238360530364 - 1.0911236359717214035600726142*I, -0.62996052494743658238360530364 + 1.0911236359717214035600726142*I]
8117
+
Complex Field with 53 bits of precision [-0.62996052494743... - 1.09112363597172*I, 1.25992104989487, -0.62996052494743... + 1.09112363597172*I]
8118
+
Complex Double Field [-0.629960524947... - 1.0911236359717...*I, 1.25992104989487..., -0.629960524947... + 1.0911236359717...*I]
8119
+
Complex Field with 100 bits of precision [-0.62996052494743658238360530364 - 1.0911236359717214035600726142*I, 1.2599210498948731647672106073, -0.62996052494743658238360530364 + 1.0911236359717214035600726142*I]
8119
8120
8120
8121
Note that we can find the roots of a polynomial with algebraic
0 commit comments