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
sage -t --long --random-seed=3113 src/sage/rings/padics/padic_base_leaves.py
**********************************************************************
File "src/sage/rings/padics/padic_base_leaves.py", line 1071, in sage.rings.padics.padic_base_leaves.pAdicFieldLattice.random_element
Failed example:
K.random_element() # random
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/sage/doctest/forker.py", line 714, in _run
self.compile_and_execute(example, compiler, test.globs)
File "/usr/lib/python3.9/site-packages/sage/doctest/forker.py", line 1133, in compile_and_execute
exec(compiled, globs)
File "<doctest sage.rings.padics.padic_base_leaves.pAdicFieldLattice.random_element[1]>", line 1, in <module>
K.random_element() # random
File "/usr/lib/python3.9/site-packages/sage/rings/padics/padic_base_leaves.py", line 1093, in random_element
x = ZZ.random_element(p**prec)
File "sage/rings/integer_ring.pyx", line 718, in sage.rings.integer_ring.IntegerRing_class.random_element (build/cythonized/sage/rings/integer_ring.c:6533)
self._randomize_mpz(z.value, x, y, distribution)
File "sage/rings/integer_ring.pyx", line 749, in sage.rings.integer_ring.IntegerRing_class._randomize_mpz (build/cythonized/sage/rings/integer_ring.c:6764)
n_max = x if isinstance(x, integer.Integer) else self(x)
File "sage/structure/parent.pyx", line 898, in sage.structure.parent.Parent.__call__ (build/cythonized/sage/structure/parent.c:9341)
return mor._call_(x)
File "sage/rings/rational.pyx", line 4164, in sage.rings.rational.Q_to_Z._call_ (build/cythonized/sage/rings/rational.cpp:32503)
raise TypeError("no conversion of this rational to integer")
TypeError: no conversion of this rational to integer
if integral:
val = 0
else:
val = ZZ.random_element()
if prec is None:
prec = self._prec_cap_absolute - val
p = self.prime()
x = ZZ.random_element(p**prec)
which is problematic as prec can be negative, so that ZZ.random_element gets called with a non-integral value. I am not sure what the intention is.
where
K = QpLC(2)
. Other possible seeds:In #29979, a doctest was marked
not tested
because of this.CC: @kliem @roed314
Component: padics
Issue created by migration from https://trac.sagemath.org/ticket/32126
The text was updated successfully, but these errors were encountered: