Sinceramente me lo calcola corrrettamente comunque tieni presente che se devi lavorare con numeri molto grandi non usare variabili integer o comunque differenti da quella finale nel calcolo. Quindi puoi trasformare la tua routine cosi':
function c(n, k: integer): extended;
var
Var1, Var2, caux: extended;
i: integer;
begin
caux := 1;
if k > n - k then
k := n - k;
for i := n - k + 1 to n do
Begin
var1 := (n + 1 - i);
Var2 := I;
caux := caux * Var2 / Var1;
end;
if k >= 0 then
c := caux
else
c := 0;
end;
il topic è vecchio ma visto che siamo in argomento vorrei segnalare questo link
https://bugs.freepascal.org/view.php?id=34378 (https://bugs.freepascal.org/view.php?id=34378)
All'interno un commento di Florian
The extended type is deprecated on win64 by MS, so it maps to double.
If you really know what you are doing, you can recompile the compiler with -dFPC_SUPPORT_X87_TYPES_ON_WIN64 to get it back, but you are at your own at this point.
Edit:
info dal mondo linux
ho lanciato il programmino di test scaricabile nel link sopra e l'ho lanciato sotto linux 64bit
non so sotto Win se le cose sono cambiate con gli extended, ma sotto linux l'extended è come ci si aspetta ;)
SizeOf(Real)=8
SizeOf(Double)=8
SizeOf(Extended)=10, but has to be 10