September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
15
Task/Forward-difference/Phix/forward-difference.phix
Normal file
15
Task/Forward-difference/Phix/forward-difference.phix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
function fwd_diff_n(sequence s, integer order)
|
||||
if order>=length(s) then ?9/0 end if
|
||||
for i=1 to order do
|
||||
for j=1 to length(s)-1 do
|
||||
s[j] = s[j+1]-s[j]
|
||||
end for
|
||||
s = s[1..-2]
|
||||
end for
|
||||
return s
|
||||
end function
|
||||
|
||||
constant s = {90, 47, 58, 29, 22, 32, 55, 5, 55, 73}
|
||||
for i=1 to 9 do
|
||||
?fwd_diff_n(s,i)
|
||||
end for
|
||||
Loading…
Add table
Add a link
Reference in a new issue