# [Maxima] Strange Bug(?)

Stavros Macrakis macrakis at alum.mit.edu
Fri Apr 18 10:43:40 CDT 2008

```I don't know what the problem is in your calculation, but I wonder if
it has to do with Maxima's treatment of inf and minf, which
unfortunately are treated just like other symbolic constants (like
%pi), so inf-inf = 0, which is of course incorrect.

Normally this wouldn't matter, since Maxima doesn't generate inf and
minf during expression manipulation, but with simpsum = true, it does,
so you get things like

sum(1,i,1,inf) - sum(2,i,1,inf) => 0

which is of course nonsense.

Try the following inf-safe sum definition and see what happens:

infvar:0\$

ssum(a,b,c,d):=
block([res: sum(a,b,c,d)],
if member(res,[inf,minf])
then concat(res,(infvar:infvar+1))
else res);

Let us know.

-s

PS I think there's a good argument to be made for having Maxima do
something similar with inf/minf it generates, making each one
distinct.  I know that someone (Raymond?) is also working on having
the simplifier not do inf-inf=>0, but there are lots of places other
than the general simplifier which need to be changed (rat
representation, compare, etc.).
```