Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -1,12 +1,12 @@
|
|||
import std.stdio;
|
||||
|
||||
T[] forwardDifference(T)(T[] s, in int n) pure {
|
||||
foreach (_; 0 .. n)
|
||||
s[] -= s[1 .. $];
|
||||
T[] forwardDifference(T)(T[] s, in int n) pure nothrow @nogc {
|
||||
foreach (immutable i; 0 .. n)
|
||||
s[0 .. $ - i - 1] = s[1 .. $ - i] - s[0 .. $ - i - 1];
|
||||
return s[0 .. $ - n];
|
||||
}
|
||||
void main() {
|
||||
immutable A = [90.5, 47, 58, 29, 22, 32, 55, 5, 55, 73.5];
|
||||
foreach (level; 0 .. A.length)
|
||||
writeln(forwardDifference(A.dup, level));
|
||||
foreach (immutable level; 0 .. A.length)
|
||||
forwardDifference(A.dup, level).writeln;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue