I am creating a program in GP/Pari
foo()=
{
coefficient = vector(2);
coefficient[1] = 1;
coefficient[2] = 2;
UserNum = Vector(2);
UserNum[1] = 1;
UserNum[2] = 2;
n=2;
for( r=1,n,
sum = coefficient[r]* UserNum[r]^r );
}
Why do i get a compilation error :
variable name not expected
It appears the error lies in the FOR LOOP but I cant tell whats wrong with my FOR LOOP , can someone help me thanks !!!