Sqrt

Category: Arithmetics
Since engine version: 1.0 OC

Description

Returns the square root of the first parameter. If the parameter is less than 0, the result is 0.

Syntax

int Sqrt(int value);

Parameter

value:
Value of which you want to take the square root.

Example

global func ObjectDistance(obj1, obj2)
{
  var dx = GetX(obj1) - GetX(obj2);
  var dy = GetY(obj1) - GetY(obj2);
  return(Sqrt(dx*dx+dy*dy));
}
Returns the distance between two objects. Notice there's also an engine function ObjectDistance.
See also: Distance, ObjectDistance
Sven2, 2001-11