Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
src/sage/rings/continued_fraction.py: Use sage.rings.abc
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Oct 23, 2021
1 parent 7e8f0bb commit fbf6666
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/sage/rings/continued_fraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2451,12 +2451,11 @@ def continued_fraction_list(x, type="std", partial_convergents=False,

cf = None

from sage.rings.real_arb import RealBallField
from sage.rings.real_mpfi import RealIntervalField, RealIntervalField_class
from sage.rings.real_mpfr import RealLiteral
if isinstance(x, RealLiteral):
from sage.rings.real_mpfi import RealIntervalField
x = RealIntervalField(x.prec())(x)
if isinstance(x.parent(), (RealIntervalField_class, RealBallField)):
if isinstance(x.parent(), (sage.rings.abc.RealIntervalField, sage.rings.abc.RealBallField)):
cf = continued_fraction(rat_interval_cf_list(
x.lower().exact_rational(),
x.upper().exact_rational()))
Expand Down Expand Up @@ -2658,8 +2657,8 @@ def continued_fraction(x, value=None):
except AttributeError:
pass

from .real_mpfi import RealIntervalField
if is_real is False:
from .real_mpfi import RealIntervalField
# we cannot rely on the answer of .is_real() for elements of the
# symbolic ring. The thing below is a dirty temporary hack.
RIF = RealIntervalField(53)
Expand Down

0 comments on commit fbf6666

Please sign in to comment.