On Wednesday, March 1, 2017 at 2:11:41 AM UTC-8, Peleg Michaeli wrote: > > Hi, > > I have two questions, one might be thought of as a bug report / feature > request, please tell me what you think. Trying > integrate(x, x, 0, infinity) > raises ValueError: Integral is divergent. > > My first question: why it does not simply return infinity? >
Arguably, infinity as an answer is bogus, and it might be more appropriate to signal a problem. Why? If you return such an answer and continue to compute with it (without displaying it ever to the user) you might simplify infinity-infinity to 0, infinity/infinity to 1, etc. So you would never know that you did bogus arithmetic, and just get a bogus answer. > (it does, by the way, if one chooses algorithm='sympy') > > Now, trying > integrate(ceil(x), x, 0, infinity) > returns something weird: > limit(1/2*(2*x + 1)*ceil(x) - 1/2*ceil(x)^2, x, +Infinity, minus) > and trying to evaluate it with `.n()` raises TypeError. > > My second question: why it does not return infinity / raises ValueError: > Integral is divergent..? > > And now, two more observations, which are certainly bugs: > > Bug 1: running > integrate(ceil(x), x, 0, infinity, algorithm='sympy') > raises AttributeError: 'module' object has no attribute 'ceiling'. I am > not sure, but I think that the problem is that in sympy there's no `ceil` > but rather `ceiling`. > > Bug 2: running > integrate(floor(x), x, 0, infinity, algorithm='sympy') > returns > integrate(floor(x), x, 0, +Infinity) > and trying to evaluate it with `.n()` returns (!!) > -679.7441466712775 > > Should I open 2 tickets for these last two bugs? > > > Thanks, > Peleg. > > > > > > -- You received this message because you are subscribed to the Google Groups "sage-devel" 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 https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
