[Maxima] makelist vs create_list

Stavros Macrakis macrakis at alum.mit.edu
Tue Apr 10 13:26:35 CDT 2007


On 4/10/07, van Nek <van.nek at arcor.de> wrote:
>
> For expressions which only use the basic operations +,-,*,/ and ^
> (polynomial expressions)
> the result is the same, due to the definition of arithmetrics with lists,
> ...
>

Yes, when listarith is true (the default).

And there is another interesting case...:

    x . x, x=[1, 2, 3], listarith:true  =>  14
vs.
    x . x, x=[1, 2, 3], listarith:false  => [1, 2, 3]^^2
vs.
   map( lambda([x], x . x),  [1, 2, 3] )  =>  [1, 4, 9]

Weirdly,
    x^^2, x=[1, 2, 3], listarith:true  =>  [ 14 ]
          (surely a bug)

More fun...

x^^2,x=[[1,2],[3,4]],listarith:false  =>  [[1,2],[3,4]]^^2
x^^2,x=[[1,2],[3,4]],listarith:true  =>  matrix([[10,20]])
map(lambda([x],x^^2),[[1,2],[3,4]]),listarith:false  =>  [[1,2]^^2,[3,4]^^2]
map(lambda([x],x^^2),[[1,2],[3,4]]),listarith:true  =>
[matrix([5]),matrix([25])]

         -s
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20070410/1ee9479a/attachment.htm 


More information about the Maxima mailing list