#1081 limit allows non-symbol variable and gives nonsense results

closed
nobody
5
2007-11-25
2007-01-21
Stavros Macrakis
No

Limit should presumably only accept variable names (symbols and subscripted symbols) as its second argument. It currently doesn't check, and gives nonsense results with non-variablename arguments:

limit(1/x,1/x,inf) => inf
(OK, why not? but see examples below)
limit(x,x^3,inf) => x (NO, should be inf if anything)
limit(x,1/x,inf) => x (NO, should be 0 if anything)
limit(sin(x),x*y,inf) => sin(x) (???)
limit(x^2+2,x^2-2,3) => x^2+2
(I suppose this ought to be 7)

Sometimes, unsurprisingly, it gets internal errors:

limit(x,sin(x),inf);
Maxima encountered a Lisp error:
Error in PROGN [or a callee]: Bad plist ($X)

Maxima 5.11.0 GCL 2.6.8 W2k Athlon

Discussion

    • labels: --> Lisp Core - Limit
     
  • Dan Gildea
    Dan Gildea
    2007-11-25

    Logged In: YES
    user_id=1797506
    Originator: NO

    Added error checking in limit.lisp rev 1.47.

    (%i52) limit(1/x, 1/x, inf);
    Improper limit variable - `limit'
    -- an error. To debug this try debugmode(true);

     
  • Dan Gildea
    Dan Gildea
    2007-11-25

    • status: open --> closed