Question: A bug in finite sum

L:=[1,2,0,4]:
s := sum(1/L[i], i=1..nops(L));

Error, (in limit/mrv/limsimpl) too many levels of recursion

So, this error cannot be caught by try

try    # bug
  s := sum(1/L[i], i=1..nops(L));
  catch:  s:=infinity
end try;

Error, (in limit/mrv/limsimpl) too many levels of recursion

Strangely, for L:=[1, 2, 0.0, 4]  it's OK.

Everything works with add instead of sum, but this is another thing.

 

Please Wait...