Skip to content

Commit db3ecc4

Browse files
committed
Make any_root deterministic for char 0 fields
1 parent c8e7464 commit db3ecc4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/sage/rings/polynomial/polynomial_element.pyx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2585,7 +2585,11 @@ cdef class Polynomial(CommutativePolynomial):
25852585
if ring not in FiniteFields():
25862586
rs = self.roots(ring=ring, multiplicities=False)
25872587
if rs:
2588-
return choice(rs)
2588+
# TODO: this has been deterministic and changing this to be random
2589+
# breaks many doctests. For now we leave it deterministic but you
2590+
# could change it to choice(rs). This mainly breaks examples over
2591+
# of elliptic curve stuff over number fields
2592+
return rs[0]
25892593
raise ValueError(f"polynomial {self} has no roots")
25902594

25912595
# Ensure that a provided ring is appropriate for the function. From the

0 commit comments

Comments
 (0)