title: Why Does Delphi's Math.Payment Function Return A Negative Number
body: <p>I'm trying to calculate the monthly payment for the following scenario:</p>
  
  <p>$5,000 is borrowed for 3 years at 8.00% compounded monthly with $1,000 due at the end of the term.</p>
  
  <pre><code>/*
  From Math.pas 
  function Payment(Rate: Extended;
   NPeriods: Integer;
   const PresentValue: Extended;
   const FutureValue: Extended;
   PaymentTime: TPaymentTime): Extended;
  */
  
  var
    Pmt : Extended;
  begin
    Pmt := Payment(0.08/12,36,5000,1000,ptEndOfPeriod);
    Edit1.Text := FloatToStr(Pmt);
  end
  </code></pre>
  
  <p>Result =  <b>-181.351526101918</b><br><br>
  The result is correct except it is negative.<br><br>
  Why does the result of the Payment function return a negative number?</p>