Arma 3 Scripting

sqrt

  • Arma 3 v0.50
  • First in Operation Flashpoint v1.00

Command · Markdown · JSON · original wiki page

Description

Returns square root of x.

Syntax

sqrt x

Parameters:

Returns: Number

Examples

Example 1

private _squareRoot = sqrt 9;  // returns 3

See also

Math Commands · a %5E b

Community notes

Benargee

Alternatively use "x^0.5" or "x^(1/2)".

_sq = 9^0.5;    // result is 3
_sq = 9^(1/2);    // result is 3

You can use this method to get any root. Cubed root = x^(1/3) or x^0.333[repeating]. Root 4 = x^(1/4) or x^0.25.