Question: How to display an Array filled with 0?

Hi, 

I'm stuck on this problem to which a careful reading of the help pages would probably give an answer:

Why is the return of Array(-1..1, [1$3]) of a different type than the one of Array(-1..1, [0$3]) ?

restart:

B := Array(-1..1,[1$3]);
lprint(B);

B := Array(-1..1, {(1) = 1})

 

Array(-1 .. 1, {-1 = 1, 0 = 1, 1 = 1})

 

B := Array(-1..1,[0$3]);
lprint(B)

B := Array(-1..1, {(1) = 0})

 

Array(-1 .. 1, {})

 

seq(B[n], n=-1..1)

0, 0, 0

(1)

 


 

Download Zero_Array.mw

Please Wait...