Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 4038 by [email protected]: Product().doit().simplify() raises OverflowError: cannot convert float infinity to integer
http://code.google.com/p/sympy/issues/detail?id=4038

k = symbols('k', integer=True, positive=True)
Pr = Product((k*(k +  1) + 1 + I)/(k*(k + 1) + 1 - I), (k,0,oo))
T = Pr.doit()
assert T.simplify() == -1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pape/sympy/sympy/core/expr.py", line 2921, in simplify
    return simplify(self, ratio, measure)
  File "/home/pape/sympy/sympy/simplify/simplify.py", line 3714, in simplify
short = shorter(short, factor_terms(short), expand_power_exp(expand_mul(short)))
  File "/home/pape/sympy/sympy/core/exprtools.py", line 981, in factor_terms
    return do(expr)
  File "/home/pape/sympy/sympy/core/exprtools.py", line 977, in do
    *[do(a) for a in p.args])
  File "/home/pape/sympy/sympy/core/exprtools.py", line 950, in do
    newargs = tuple([do(i) for i in args])
  File "/home/pape/sympy/sympy/core/exprtools.py", line 950, in do
    newargs = tuple([do(i) for i in args])
  File "/home/pape/sympy/sympy/core/exprtools.py", line 978, in do
    rv = _keep_coeff(cont, p, clear=clear, sign=sign)
  File "/home/pape/sympy/sympy/core/mul.py", line 1574, in _keep_coeff
    if r == int(r):
  File "/home/pape/sympy/sympy/core/expr.py", line 215, in __int__
    r = self.round(2)
  File "/home/pape/sympy/sympy/core/expr.py", line 3051, in round
    mag_first_dig = _mag(x)
  File "/home/pape/sympy/sympy/core/expr.py", line 3123, in _mag
    mag_first_dig = int(ceil(C.Float(mpf_log(xpos._mpf_, 53))/log(10)))
OverflowError: cannot convert float infinity to integer

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy-issues.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to