SystemSqrt (Delphi)
Description
This example uses the System Sqr and Sqrt functions to calculate mathematical values.
Code
procedure TForm1.Button1Click(Sender: TObject);
var
S, Temp: string;
begin
Str(Sqr(5.5):3:1, Temp);
S := '5.5 squared is ' + Temp + #13#10;
MessageDlg(S, mtInformation, [mbOk], 0);
end;
procedure TForm1.Button2Click(Sender: TObject);
var
S, Temp: string;
begin
Str(Sqrt(2.0):5:4, Temp);
S := S + 'The square root of 2 is ' + Temp;
MessageDlg(S, mtInformation, [mbOk], 0);
end;
Uses
- System.Sqr ( fr | de | ja )
- System.Sqrt ( fr | de | ja )