Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,14 @@
$ include "seed7_05.s7i";
const proc: main is func
local
var integer: n is 0;
var integer: k is 0;
begin
for n range 0 to 66 do
for k range 0 to n do
write(n ! k <& " ");
end for;
writeln;
end for;
end func;

View file

@ -0,0 +1,26 @@
const func bigInteger: (in bigInteger: n) ! (in var bigInteger: k) is func
result
var bigInteger: binom is 0_;
local
var bigInteger: numerator is 0_;
var bigInteger: denominator is 0_;
begin
if n >= 0_ and k > n >> 1 then
k := n - k;
end if;
if k < 0_ then
binom := 0_;
elsif k = 0_ then
binom := 1_;
else
binom := n;
numerator := pred(n);
denominator := 2_;
while denominator <= k do
binom *:= numerator;
binom := binom div denominator;
decr(numerator);
incr(denominator);
end while;
end if;
end func;