>I define a function f as
>f(x):=block([],if(x>=-1 and x<-1/4) then return(2),if(x>=-1/4 and x<0) then return(-1),if(x>=0 and x<1/4) then return(1),if(x>=1/4 and x<1) then return(-2));
>How I can continue this function on the whole R periodically (by period 2)?
Something like the following should work:
(%i18) g(x) := (x : mod(x+1,2)-1, if x < -1/4 then 2 else if x < 0 then -1 else if x < 1/4 then 1 else -2)$
(%i19) wxplot2d('(g(x)),[x,-1,4]);
--Barton