Apply a digital filter (direct form II transposed): Difference between revisions
Content deleted Content added
m →version 1: made the displaying of the results into a subroutine to correctly handle the number of (specified) decimal digits. |
Walterpachl (talk | contribs) →REXX version 2: increase precision to avoid rounding of s.1=etc. |
||
Line 465:
{{trans|Julia}}
<lang REXX>/* REXX */
Numeric Digits 20
acoef = '1.00000000, -2.77555756e-16, 3.33333333e-01, -1.85037171e-17'
bcoef = '0.16666667, 0.5, 0.5, 0.16666667'
Line 493 ⟶ 494:
End
ret.i=temp/a.1
Say format(i,2) format(ret.i,2,
End</lang>
{{out|output}}
<pre>
2 -0.
3 -0.
4 0.
5 0.
6 -0.
7 -1.
8 -0.
9 0.
10 1.
11 0.
12 0.
13 0.
14 0.
15 -0.
16 -0.
17 -0.
18 0.
19 0.
20 0.
=={{header|Sidef}}==
|