fpc/tests/webtbs/tw5094.pp
Jonas Maebe 00f401693c * fixed web bug #5094. Renaming registers is now done sequentially instead
of all at the same time, because otherwise circular renamings could
    cause errors

git-svn-id: trunk@3644 -
2006-05-23 17:17:23 +00:00

21 lines
318 B
ObjectPascal

{ %OPT=-O-1 -Ooasmcse -Oonoregvar }
function B(n, k: Integer):Integer;
var
i: Integer;
begin
if k > n-k then
k := n-k;
B := 1;
for i := n-k+1 to n do
B := B * i;
for i := 2 to k do
B := B div i;
end;
begin
if B(0,1) <> 1 then
halt(1); { Should write 1; fpc -O1 binom.pas writes 0 }
end.