Talk:Trigonometric functions: Difference between revisions
Content added Content deleted
Walterpachl (talk | contribs) |
Walterpachl (talk | contribs) |
||
Line 38: | Line 38: | ||
A possible remedy is to compute the function with a higher precision |
A possible remedy is to compute the function with a higher precision |
||
and then round the result to the desired one |
and then round the result to the desired one |
||
<pre> |
|||
ps=0.09983341664682815230681419841062199 |
ps=0.09983341664682815230681419841062199 |
||
0.0998334166468281523068141984106 |
0.0998334166468281523068141984106 |
||
</pre> |
|||
These lines come from |
These lines come from |
||
pSIN: procedure |
pSIN: procedure |
||
/* Calculate sin(x) to the specified precision */ |
/* Calculate sin(x) to the specified precision */ |
||
parse arg X, P |
parse arg X, P |
||
Numeric Digits (p+2) |
Numeric Digits (p+2) |
||
ps=sin(x) |
ps=sin(x) |
||
Say 'ps='ps |
Say 'ps='ps |
||
Numeric Digits p |
Numeric Digits p |
||
Say ' '||(ps+0) |
Say ' '||(ps+0) |
||
Return ps+0 |
Return ps+0 |
||
--[[User:Walterpachl|Walterpachl]] 19:43, 22 June 2012 (UTC) |
--[[User:Walterpachl|Walterpachl]] 19:43, 22 June 2012 (UTC) |