Question: Illegal use of a formal parameter.

Trying to write a procedure to just reduce the vales of x.. 

restart: 

proc_r:= proc(x :: numeric) 

local x0:

x := x0: 

 

#reducing the value to between -Pi and Pi

 

do 

 if ( x0 <= evalf(Pi) ) then 

  break: 

 end if: 

 

 x0 := x0 - 2*evalf(Pi)

end do: 

 

do 

 if (x0 >= evalf(-Pi) ) then

  break: 

 end if:

 

 x0 := x0 + 2*evalf(Pi)

end do: 

 

#using the symmetry of sin to reduce to between -Pi/2 and Pi/2 

 

 if (x0 <= evalf(Pi/2) ) then  

 break:

end if: 

x0 := evalf(Pi) - x0:

 

if (x0 >= evalf(-Pi/2) ) then 

 break:

end if: 

x0 := evalf(-Pi) - x0:

 

return x0:

 

end proc:

 

proc_r(7);  

 

Error, (in proc_r) illegal use of a formal parameter

 

Why do i get this error message... 
How do i fix it? 

Please Wait...