Skip to content

Commit b35733c

Browse files
author
Release Manager
committed
Trac #33234: Fix randrange deprecation warning with python-3.10
{{{ .../sage/rings/qqbar.py:2863: DeprecationWarning: non-integer arguments to randrange() have been deprecated since Python 3.10 and will be removed in a subsequent version roots = p.roots(ring, False) }}} URL: https://trac.sagemath.org/33234 Reported by: mjo Ticket author(s): Michael Orlitzky Reviewer(s): Frédéric Chapoton
2 parents 3c6ce75 + eabf53c commit b35733c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sage/rings/polynomial/real_roots.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,9 @@ cdef class interval_bernstein_polynomial:
409409
# A different algorithm here might be more efficient.
410410

411411
div = 1024
412-
while self.degree() >= div//4:
412+
while self.degree() >= (div // 4):
413413
div = div * 2
414-
qdiv = div/4
414+
qdiv = div // 4 # divides evenly since div = 1024*2^k
415415
rand = Integer(ctx.random.randrange(qdiv, 3*qdiv)) / div
416416
(p1, p2, ok) = self.de_casteljau(ctx, rand)
417417
ctx.dc_log_append(("div" + self._type_code(), self.scale_log2, self.bitsize, rand, ok, logging_note))

0 commit comments

Comments
 (0)