Bill Allombert on Sun, 13 Nov 2005 11:50:56 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Little problems


On Sat, Nov 12, 2005 at 11:35:44PM +0100, Martin Larsen wrote:
> First this:
> >acos(cos(I))
>  *** acos: bug in GP (Segmentation Fault), please report

Apparently, you are using PARI/GP 2.2.9. This bug was not
present in previous releases and was fixed in PARI/GP 2.2.10.
I would suggest you to upgrade to PARI/GP 2.2.11.

> Then this:
> 
> >a=matid(8);
> 
> Now I will try to generate a matrix recursively.
> Only s[1,] is importent at start. 

I suppose you mean a[1,] ?
 
> It's repeated 3 times make the error clear. 
> 3. time is correct. If I do the same thing with 
> 2 for-loops the correct result is there 1. time. 
> 
> >matrix(6,6,i,j,a[i+1,j+1]=a[i,j]+3*a[i,j+1]+2*a[i,j+2])

In case it is not clear: what you do is equivalent to

for(i=1,6,for(j=1,6,a[i+1,j+1]=a[i,j]+3*a[i,j+1]+2*a[i,j+2]));
matrix(6,6,i,j,a[i+1,j+1])

You are modifying the matrix 'a' each time, so you will not get
the same result unless you reset 'a' with a=matid(8);

> I suppose it is a bug in Pari (?) 

It is not a bug: you are changing the matrix a.

> Another thing: if I do this (it's only working with the letter 'i') 
> 5^i , then my inputline look like this
> :
> (could I have this explained).

Are you using the Windows version ?  Maybe the system translated 
^i to î, or something. It might be related to bug #102, see
<http://pari.math.u-bordeaux.fr/Bugs/102>

Or maybe I completly misunderstood you.

Cheers,
Bill.