Question: Rectangular Function

my function is:

f := proc (x) if 0 < x and x < evalf(Pi) then 1 elif evalf(Pi) < x and x < evalf(2*Pi) then -1 end if end proc

now it tried:

f1 := add((-1)^n*f(x-evalf(2*n*Pi)), n = 0 .. 10)

to get a periodic function.

but unfortunately it says:

Error, (in f) cannot determine if this expression is true or false: 0 < x and x < 3.141592654
already when trying to calc the sum.
Please Wait...