Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #32774: Bug in continued fraction doctest
Part of #32544: {{{ sage -t --long --random-seed=77478494819088915365500074763386376542 src/sage/rings/continued_fraction.py ********************************************************************** File "src/sage/rings/continued_fraction.py", line 265, in sage.rings.continued_fraction.rat_interval_cf_list Failed example: for prec in range(10,54): R = RealIntervalField(20) for _ in range(100): x = R.random_element() * R.random_element() + R.random_element() / 100 l = x.lower().exact_rational() u = x.upper().exact_rational() cf = rat_interval_cf_list(l,u) a = continued_fraction(cf).value() b = continued_fraction(cf+[1]).value() if a > b: a,b = b,a assert a <= l assert b >= u Exception raised: Traceback (most recent call last): File "/home/jonathan/Applications/sage/local/lib/python3.8/site- packages/sage/doctest/forker.py", line 694, in _run self.compile_and_execute(example, compiler, test.globs) File "/home/jonathan/Applications/sage/local/lib/python3.8/site- packages/sage/doctest/forker.py", line 1088, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.continued_fraction.rat_interval_cf_list[2]>", line 8, in <module> a = continued_fraction(cf).value() File "/home/jonathan/Applications/sage/local/lib/python3.8/site- packages/sage/rings/continued_fraction.py", line 2625, in continued_fraction x1, x2 = check_and_reduce_pair(x) File "/home/jonathan/Applications/sage/local/lib/python3.8/site- packages/sage/rings/continued_fraction.py", line 2254, in check_and_reduce_pair raise ValueError("continued fraction can not represent infinity") ValueError: continued fraction can not represent infinity ********************************************************************** 1 item had failures: 1 of 4 in sage.rings.continued_fraction.rat_interval_cf_list [437 tests, 1 failure, 5.09 s] ------------------------------------------------------------- }}} URL: https://trac.sagemath.org/32774 Reported by: gh-kliem Ticket author(s): Jonathan Kliem Reviewer(s): Kwankyu Lee
- Loading branch information