用delphi自带的sqr和sqrt函数
procedure TForm2.SpeedButton3Click(Sender: TObject); begin ShowMessage(Sqr(6).ToString); //36 end; procedure TForm2.SpeedButton4Click(Sender: TObject); begin ShowMessage(sqrt(36).ToString); //6 end;