unit SystemSqrt;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: SystemSqrt
// Routine: System.Sqr
// Routine: System.Sqrt

// BeginCode
{
This example uses the System Sqr and Sqrt functions to calculate
the some mathematical values.
}

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;
// EndCode
// EndExample: SystemSqrt
end.
