title: Delphi: How to correctly divide to a float number
body: <p>First day using Delphi Community IDE, I've been able to create a calculator app. I've done mostly <code>Python</code> and <code>R</code> programming.</p>
  
  <p>But I'm having trouble with the Division Operation. I've hardcoded 2 values just to make sure the operation is based on float numbers.</p>
  
  <p>I would like to get <code>2.5</code> in the panel caption, when dividing 5 to 2.</p>
  
  <pre><code>iAns := 5 / 2.0; yields:
  
  [dcc32 Error] hello_world.pas(189): E2010 Incompatible types: 'Integer' and 'Extended'
  [dcc32 Error] hello_world.pas(189): E2010 Incompatible types: 'Integer' and 'Extended'
  [dcc32 Fatal Error] Project1.dpr(5): F2063 Could not compile used unit 'hello_world.pas'
  </code></pre>
  
  <p><strong>This is the function that does the operation based on if else conditionals:</strong></p>
  
  <pre><code>procedure TForm1.btnEqualsClick(Sender: TObject);
  begin
  iNum2 := StrToInt(edt1.Text);
  edt1.Clear;
  ShowMessage(IntToStr(iNum1));
  ShowMessage(IntToStr(iNum2));
  
  if Operant = '+' then
      begin
          iAns := iNum1 + iNum2;
          pnl1.Caption :=  IntToStr(iAns);
      end
  else if Operant = '-' then
      begin
          iAns := iNum1 - iNum2;
          pnl1.Caption :=  IntToStr(iAns);
      end
  else if Operant = '*' then
      begin
          iAns := iNum1 * iNum2;
          pnl1.Caption :=  IntToStr(iAns);
      end
  else if Operant = '/' then
      begin
          iAns := 5 / 2.0;
          pnl1.Caption :=  FloatToStr(iAns);
      end
  end;
  
  end.
  </code></pre>
  
  <p><strong>UPDATE 1</strong>:</p>
  
  <pre><code>var
    Form1: TForm1;
    iNum1, iNum2, iAns : Integer;
    rNum1, rNum2, rAns : Integer;
    Operant : String;
  </code></pre>