Ralf Stephan on Sun, 31 Jan 2016 05:31:20 +0100


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

Re: What am I doing wrong? Extremely simple problem


Did you try without braces?


On Sun, 31 Jan 2016 02:04 carl hansen <carlhansen1234@gmail.com> wrote:
some simple functions:


p3(x) = { x*(x+1)/2 }
p4(x) = { x*x }
p5(x) = { x*((3*x)-1)/2 }
p6(x) = { x*((2*x)−1) }
p7(x) =  { x*(5*x−3)/2 }
p8(x) = { x*(3*x−2) }

unexpected results:
                                        GP/PARI CALCULATOR Version 2.7.5 (released)
                               amd64 running linux (x86-64/GMP-6.1.0 kernel) 64-bit version
                                      compiled: Jan 27 2016, gcc version 4.9.3 (GCC)
                                                 threading engine: single
? p3(x) = { x*(x+1)/2 }
%1 = (x)->x*(x+1)/2
? p4(x) = { x*x }
%2 = (x)->x*x
? p5(x) = { x*((3*x)-1)/2 }
%3 = (x)->x*((3*x)-1)/2
? p6(x) = { x*((2*x)−1) }
  ***   syntax error, unexpected $undefined, expecting )-> or ',' or ')': p6(x)=x*((2*x)−1)
  ***                                                                                       ^-
? p7(x) =  { x*(5*x−3)/2 }
  ***   syntax error, unexpected $undefined, expecting )-> or ',' or ')': p7(x)=x*(5*x−3)/2
  ***                                                                                     ^---
? p8(x) = { x*(3*x−2) }
  ***   syntax error, unexpected $undefined, expecting )-> or ',' or ')': p8(x)=x*(3*x−2)
  ***                                                                                     ^-
?