示例#1
0
 def eval(cls, m):
     if m.is_odd:
         return S.Zero
     if m.is_Integer and m.is_nonnegative:
         from sympy.mpmath import mp
         m = m._to_mpmath(mp.prec)
         res = mp.eulernum(m, exact=True)
         return Integer(res)
示例#2
0
文件: numbers.py 项目: sunny94/temp
 def eval(cls, m):
     if m.is_odd:
         return S.Zero
     if m.is_Integer and m.is_nonnegative:
         from sympy.mpmath import mp
         m = m._to_mpmath(mp.prec)
         res = mp.eulernum(m, exact=True)
         return Integer(res)
示例#3
0
    def _eval_evalf(self, prec):
        m = self.args[0]

        if m.is_Integer and m.is_nonnegative:
            from sympy.mpmath import mp
            from sympy import Expr
            m = m._to_mpmath(prec)
            with workprec(prec):
                res = mp.eulernum(m)
            return Expr._from_mpmath(res, prec)
示例#4
0
    def _eval_evalf(self, prec):
        m = self.args[0]

        if m.is_Integer and m.is_nonnegative:
            from sympy.mpmath import mp
            from sympy import Expr
            m = m._to_mpmath(prec)
            with workprec(prec):
                res = mp.eulernum(m)
            return Expr._from_mpmath(res, prec)
示例#5
0
 def eval(cls, m, evaluate=None):
     if evaluate is None:
         evaluate = global_evaluate[0]
     if not evaluate:
         return
     if m.is_odd:
         return S.Zero
     if m.is_Integer and m.is_nonnegative:
         from sympy.mpmath import mp
         m = m._to_mpmath(mp.prec)
         res = mp.eulernum(m, exact=True)
         return Integer(res)