Skip to content

Commit

Permalink
Apply suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
user202729 committed Dec 8, 2024
1 parent 2b08102 commit f398a0f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
9 changes: 3 additions & 6 deletions src/sage/libs/mpmath/ext_main.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,7 @@ cdef class Context:
s = (<mpc>x).re.special
t = (<mpc>x).im.special
return s == S_NAN or t == S_NAN
if isinstance(x, (int, Integer)) \
or isinstance(x, rationallib.mpq):
if isinstance(x, (int, Integer, rationallib.mpq)):
return False
typ = MPF_set_any(&tmp_opx_re, &tmp_opx_im, x, global_opts, 0)
if typ == 1:
Expand Down Expand Up @@ -622,8 +621,7 @@ cdef class Context:
s = (<mpc>x).re.special
t = (<mpc>x).im.special
return s == S_INF or s == S_NINF or t == S_INF or t == S_NINF
if isinstance(x, (int, Integer)) \
or isinstance(x, rationallib.mpq):
if isinstance(x, (int, Integer, rationallib.mpq)):
return False
typ = MPF_set_any(&tmp_opx_re, &tmp_opx_im, x, global_opts, 0)
if typ == 1:
Expand Down Expand Up @@ -671,8 +669,7 @@ cdef class Context:
if re == libmp.fzero: return im_normal
if im == libmp.fzero: return re_normal
return re_normal and im_normal
if isinstance(x, (int, Integer)) \
or isinstance(x, rationallib.mpq):
if isinstance(x, (int, Integer, rationallib.mpq)):
return bool(x)
x = ctx.convert(x)
if hasattr(x, '_mpf_') or hasattr(x, '_mpc_'):
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/finite_rings/finite_field_base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,7 @@ cdef class FiniteField(Field):
False
"""
from sage.rings.integer_ring import ZZ
if R in int or R is ZZ:
if R is int or R is ZZ:
return True
if isinstance(R, sage.rings.abc.IntegerModRing) and self.characteristic().divides(R.characteristic()):
return R.hom((self.one(),), check=False)
Expand Down
4 changes: 1 addition & 3 deletions src/sage/rings/real_mpfi.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -816,9 +816,7 @@ cdef class RealIntervalField_class(sage.rings.abc.RealIntervalField):
prec = self._prec

# Direct and efficient conversions
if S is ZZ or S is QQ:
return True
if S is int:
if S is ZZ or S is QQ or S is int:
return True
if isinstance(S, RealIntervalField_class):
return (<RealIntervalField_class>S)._prec >= prec
Expand Down

0 comments on commit f398a0f

Please sign in to comment.