def evalf_piecewise(expr, prec, options): if 'subs' in options: expr = expr.subs(options['subs']) del options['subs'] if hasattr(expr, 'func'): return evalf(expr, prec, options) if type(expr) == float: return evalf(C.Float(expr), prec, options) if type(expr) == int: return evalf(C.Integer(expr), prec, options) # We still have undefined symbols raise NotImplementedError
def ceiling(self): return C.Integer(int(mlib.to_int(mlib.mpf_ceil(self._mpf_, self._prec))))
def floor(self): return C.Integer(int(mlib.to_int(mlib.mpf_floor(self._mpf_, self._prec))))