lkr #2382(2007/08/22 13:30 GMT) [ Ruby ] Rating0/0=0.00
1 2 3 4 5 6 7 8 9
def diff(xs) raise ArgumentError unless xs.size >= 2 (0..xs.size-1-1).map{ |n| xs[n+1] - xs[n] } end p diff( [3, 1, 4, 1, 5, 9, 2, 6, 5] )
Rating0/0=0.00-0+
[ reply ]
lkr
#2382()
[
Ruby
]
Rating0/0=0.00
Rating0/0=0.00-0+
[ reply ]