Trigonometric functions: Difference between revisions

m
→‎{{header|REXX}}: updated the .sinCos subroutine.
(→‎{{header|REXX}}: updated program code, elided STYLE from PRE html tag.)
m (→‎{{header|REXX}}: updated the .sinCos subroutine.)
Line 3,152:
if abs(x)=pi | x=0 then return 0; return .sinCos(x, x, +1)
 
.sinCos: parse arg z 1 p,_,i; x=x*x
do k=2 by 2 until p=z; p=z; _=-_*x/(k*(k+i)); z=z+_;if z=p then leave;p=z;end; return z/*k*/
return z
 
sqrt: procedure; parse arg x,i; if x=0 then return 0; d=digits(); m.=11