On Thu, 27 Mar 2008 23:44:27 -0700
"William Stein" <[EMAIL PROTECTED]> wrote:

> 
> On Thu, Mar 27, 2008 at 11:29 PM, Nils Bruin <[EMAIL PROTECTED]> wrote:
> >
> >  I tried the first example below in sage. It failed , complaining that
> >  maxima wanted to know whether x was positive, negative or 0. Hence, I
> >  tried maxima via "sage -maxima". To my surprise, maxima computed the
> >  limit without asking for extra information. Is the maxima that gets
> >  called from sage put in a more inquisitive mode?
> >
> >  I figure this might be a symptom of a sub-optimal interaction between
> >  sage and maxima and hence might have some interest to developers.
> 
> This is almost certainly related to us putting Maxima in "complex numbers"
> mode by default, since Maxima's non-complex mode is very stupid in numerous
> ways, as Paul Zimmerman has pointed out.
> 
> >
> >  
> > ///////////////////////////////////////////////////////////////////////////////////
> >  %sage
> >  var('p x')
> >  limit((p+1)/pi*(1-x^2/4)/((sqrt(p)+sqrt(1/p))^2-x^2),p=oo)
> >
> >  //complains that maxima wants extra information
> >
> >  
> > ////////////////////////////////////////////////////////////////////////////////////
> >  %maxima
> >  f(p,x):=(p+1)/pi*(1-x^2/4)/((sqrt(p)+sqrt(1/p))^2-x^2);
> >  limit(f(p,x),p, infinity);
> >
> >  //works
> 
> The issue is that you're passing in "infinity" which *not* what
> Sage converts oo to:
> 
> sage: maxima(oo)
> inf
> sage: maxima('infinity')
> infinity
> 
> Maxima has the "brilliant" design that inf = real infinity and
> infinity = complex infinity:
> 
> (%i8) describe(infinity);
>  -- Constant: infinity
>      `infinity' represents complex infinity.
> (%o8)                                true
> (%i9) describe(inf);
>  -- Constant: inf
>      `inf' represents real positive infinity.
> 
> I guess Maxima must not have a referee system for their code...
> 
> Anyway, I'm not sure what to do about this.  I don't even know what
> "complex infinity" means...
> But hopefully this sheds some light.

Complex infinity is the unsigned infinity. In Sage the "oo" in the default 
namespace is signed infinity:

sage: oo
+Infinity
sage: -oo
-Infinity
sage: unsigned_infinity
Infinity

There is at least one bug in Sage here:

sage: maxima(unsigned_infinity)
inf

> By the way, if you ever design a computer algebra system, please don't
> make inf and infinity be
> two different kinds of infinity. Gees that's almost as confusing as
> making Matrix and matrix
> drastically different[*].


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to