z: -q/p$
Maxima considers the "external" form of this expression to be
"-"("/"(q,p)), hence:
part(z,0) => "-"
part(z,1) => q/p
part(z,1,1) => q
part(z,1,2)=> p
The internal form is "*"(-1,"^"(p,-1),q), hence:
inpart(z,0) => "*"
inpart(z,1) => -1
etc.
If p and q are both numbers, then the external form is the same, but the
internal form of e.g. -2/3 is "/"(-2,3).
-s
On Sun, May 13, 2012 at 2:07 PM, Jean-Fran?ois MAUREL
<jfr.maurel at gmail.com>wrote:
> Hi,
>
> I am new to maxima and I have trouble with part().
>
> This works as expected:
> z:q/p;
> part(z,0);
> part(z,1);
> part(z,2);
> (%o48) q/p
> (%o49) "/"
> (%o50) q
> (%o51) p
> This doesn't:
> z:-q/p;
> part(z,0);
> part(z,1);
> part(z,2);
> (%o52) -q/p
> (%o53) "-"
> (%o54) q/p
> part: fell off the end.
>
> Could you please tell me what I am missing here to pick (-q) and p ?
>
> Regards
>
> JF Maurel
>
> PS: thank you to all developpers for this fantastic software.
> ______________________________**_________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/**mailman/listinfo/maxima<http://www.math.utexas.edu/mailman/listinfo/maxima>
>