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=5058 src/sage/rings/continued_fraction_gosper.py
**********************************************************************
File "src/sage/rings/continued_fraction_gosper.py", line 63, in sage.rings.continued_fraction_gosper.gosper_iterator.__init__
Failed example:
continued_fraction((preperiod, period), x.value()) == continued_fraction((a*x.value()+b)/(c*x.value()+d))
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.continued_fraction_gosper.gosper_iterator.__init__[8]>", line 1, in <module>
continued_fraction((preperiod, period), x.value()) == continued_fraction((a*x.value()+b)/(c*x.value()+d))
File "/usr/lib/python3.9/site-packages/sage/rings/continued_fraction.py", line 2618, in continued_fraction
x1, x2 = check_and_reduce_pair(x1, x2)
File "/usr/lib/python3.9/site-packages/sage/rings/continued_fraction.py", line 2257, in check_and_reduce_pair
raise ValueError("the elements of the period cannot be negative")
ValueError: the elements of the period cannot be negative
which comes from this example and apparently should not return negative values:
sage: a, b, c, d = 6, -9, -2, 3
sage: from sage.rings.continued_fraction_gosper import gosper_iterator
sage: x = continued_fraction(([1,2],[3,4])); i = iter(gosper_iterator(a,b,c,d,x))
sage: list(i)
[-3]
Note that (6,-9) == -3 * (-2,3).
In #29979, a doctest was marked not tested because of this.
which comes from this example and apparently should not return negative values:
Note that
(6,-9) == -3 * (-2,3)
.In #29979, a doctest was marked
not tested
because of this.CC: @kliem @videlec
Component: number theory
Issue created by migration from https://trac.sagemath.org/ticket/32127
The text was updated successfully, but these errors were encountered: