I want to write a function SWAP to swap 2 integers a and b in PARI. This function does not return any values but I want the variables outside the function to store the new values. I don't know how to fix this. This is my function:
swap(a,b) = { t=a; a=b; b=t;}
Then I write:
u=2; v=3;
swap(u,v);
ten u is still 2 and v is still 3. How can I rewrite this function to make u=3 and v=2? Thank you.