Skip to content

Sqrt ​

Sqrt returns the square root of the value specified by the parameter e.

A square root of a number, is a number that can be multiplied by itself to get the resulting number. For instance, the square root of sixteen (16) is four (4), because four (4) times four (4) equals sixteen (16).

Declaration: Function Sqrt(e : Extended) : Extended

Example

pascal
procedure ScriptEvent(var Value:Variant);
var
  aSq : extended;
begin
 //Result is 11.0905365064094
  aSq := Sqrt(123);
  LogInfo(FloatToStr(aSq));

 //Result is 4
  LogInfo(FloatToStr(Sqrt(16)));

 //Result is 10
  LogInfo(FloatToStr(Sqrt(100)));

 //Result is 7.54983443527075
  LogInfo(FloatToStr(Sqrt(57)));
  LogInfo('');

end;