diff --git a/src/sage/libs/mpmath/ext_main.pyx b/src/sage/libs/mpmath/ext_main.pyx index 29d524536ea..99a0c782423 100644 --- a/src/sage/libs/mpmath/ext_main.pyx +++ b/src/sage/libs/mpmath/ext_main.pyx @@ -1815,7 +1815,7 @@ cdef class mpf_base(mpnumber): sage: X().to_fixed(30) 3489660928 """ - return libmp.to_fixed(self._mpf_, prec) + return libmp.to_fixed(self._mpf_, prec) def __getstate__(self): return libmp.to_pickable(self._mpf_) @@ -2135,6 +2135,9 @@ cdef class mpf(mpf_base): MPF_sqrt(&r.value, &s.value, global_opts) return r + def __round__(self, *args): + return round(float(self), *args) + def __richcmp__(self, other, int op): """ Compares numbers ::