Skip to main content Link Search Menu Expand Document Toggle dark mode Copy Code (external link)

sqrt() : Square Root

Calculate the square root of a number.


On this page

Signature

sqrt(value)

Parameters

Parameter Type Required Description
value Number Yes The number (must be non-negative)

Returns

Type: Double

The square root of the value.


Examples

Basic Square Root

<p>√{{model.value}} = {{format(sqrt(model.value), '0.00')}}</p>

Data:

doc.Params["model"] = new {
    value = 25
};

Output:

<p>√25 = 5.00</p>

Calculate Distance

<p>Distance: {{format(sqrt(model.dx * model.dx + model.dy * model.dy), '0.00')}} units</p>

Data:

doc.Params["model"] = new {
    dx = 3,
    dy = 4
};

Output:

<p>Distance: 5.00 units</p>

Standard Deviation Component

<p>Std Dev: {{format(sqrt(model.variance), '0.000')}}</p>

Data:

doc.Params["model"] = new {
    variance = 15.625
};

Output:

<p>Std Dev: 3.953</p>

Notes

  • Returns double-precision floating-point
  • Value must be non-negative (≥ 0)
  • Negative values will throw an exception
  • For nth root, use pow(value, 1/n)
  • Common in geometric and statistical calculations

See Also