June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -1 +1,4 @@
|
|||
ndiff(A, n::Integer) = n < 1 ? A : diff(ndiff(A, n-1))
|
||||
ndiff(A::Array, n::Integer) = n < 1 ? A : diff(ndiff(A, n-1))
|
||||
|
||||
s = [90, 47, 58, 29, 22, 32, 55, 5, 55, 73]
|
||||
println.(collect(ndiff(s, i) for i in 0:9))
|
||||
|
|
|
|||
28
Task/Forward-difference/Ring/forward-difference.ring
Normal file
28
Task/Forward-difference/Ring/forward-difference.ring
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# Project : Forward difference
|
||||
# Date : 2018/01/19
|
||||
# Author : Gal Zsolt [~ CalmoSoft ~]
|
||||
# Email : <calmosoft@gmail.com>
|
||||
|
||||
s = [90, 47, 58, 29, 22, 32, 55, 5, 55, 73]
|
||||
for p = 1 to 9
|
||||
s = fwddiff(s)
|
||||
showarray(s)
|
||||
next
|
||||
|
||||
func fwddiff(s)
|
||||
for j=1 to len(s)-1
|
||||
s[j] = s[j+1]-s[j]
|
||||
next
|
||||
n = len(s)
|
||||
del(s, n)
|
||||
return s
|
||||
|
||||
func showarray(vect)
|
||||
see "{"
|
||||
svect = ""
|
||||
for n = 1 to len(vect)
|
||||
svect = svect + vect[n] + ", "
|
||||
next
|
||||
svect = left(svect, len(svect) - 2)
|
||||
see svect
|
||||
see "}" + nl
|
||||
Loading…
Add table
Add a link
Reference in a new issue