Esta es la función en D5:
Código Delphi
[-]function Payment(Rate: Extended; NPeriods: Integer; PresentValue, FutureValue:
Extended; PaymentTime: TPaymentTime): Extended;
var
Annuity, CompoundRN: Extended;
begin
if Rate <= -1.0 then ArgError('Payment');
Annuity := Annuity2(Rate, NPeriods, PaymentTime, CompoundRN);
if CompoundRN > 1.0E16 then
Payment := -PresentValue * Rate / (1 + Integer(PaymentTime) * Rate)
else
Payment := (-PresentValue * CompoundRN - FutureValue) / Annuity
end;
Un Saludo.