Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#2711 `i' is not local in `geosum'

None
closed
nobody
functs (2)
5
2014-05-16
2014-03-28
Sergey Litvinov
No

'i' is not local in 'geosum' and is treated specially unlike in similar function 'arithsum'.

(%i2) geosum(1, 1, 'inf), i: 42;
limit: second argument must be a variable, not a constant; found: 42
#0: geosum(a=1,r=1,n=inf)(functs.mac line 81)
 -- an error. To debug this try: debugmode(true);

Here is a definition from share/simplification/functs.mac:

          geosum(a,r,n):=block([],
            if r=1
                then if n='inf
                        then return(limit(i*a,i,'inf))
                        else return(n*a),
            if r=-1
                then error("The series is not convergent"),
            if n='inf 
                then if abs(r) < 1 
                        then a/(1-r)
                        else limit(a*(1-r^i)/(1-r),i,'inf)
                else a*(1-r^n)/(1-r)   )$

My setup is

(%i3) build_info();
(%o3) 
Maxima version: "branch_5_32_base_93_g33a7882"
Maxima build date: "2014-03-27 19:40:19"
Host type: "x86_64-unknown-linux-gnu"
Lisp implementation type: "CLISP"
Lisp implementation version: "2.49 (2010-07-07) (built 3575122160) (memory 3604934424)"

Discussion

    • status: open --> closed
     
  • I've fixed this and some other bugs in [75f6d0]. I'm not really convinced that geosum is useful for anyone (see the commit message), but at least this bug has gone now.

     

    Related

    Commit: [75f6d0]