Skip to content

Commit 4051446

Browse files
committed
corrected the test case by sorting the result
1 parent 272582b commit 4051446

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/sage/rings/polynomial/polynomial_element.pyx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8105,6 +8105,7 @@ cdef class Polynomial(CommutativePolynomial):
81058105
....: f2 = x2^3 - fld_out(2)
81068106
....: for algo in (None, 'pari', 'numpy'):
81078107
....: rts = f.roots(ring=fld_out, multiplicities=False)
8108+
....: rts = sorted(rts, key=lambda x: (x.real(), x.imag()))
81088109
....: if fld_in == fld_out and algo is None:
81098110
....: print("{} {}".format(fld_in, rts))
81108111
....: for rt in rts:
@@ -8113,9 +8114,9 @@ cdef class Polynomial(CommutativePolynomial):
81138114
Real Field with 53 bits of precision [1.25992104989487]
81148115
Real Double Field [1.25992104989...]
81158116
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, -0.62996052494743... + 1.09112363597172*I, 1.25992104989487]
8118+
Complex Double Field [-0.629960524947... - 1.0911236359717...*I, -0.629960524947... + 1.0911236359717...*I, 1.25992104989...]
8119+
Complex Field with 100 bits of precision [-0.62996052494743658238360530364 - 1.0911236359717214035600726142*I, -0.62996052494743658238360530364 + 1.0911236359717214035600726142*I, 1.2599210498948731647672106073]
81198120
81208121
Note that we can find the roots of a polynomial with algebraic
81218122
coefficients::

0 commit comments

Comments
 (0)