Skip to main content Link Search Menu Expand Document (external link)

sqrt() : Square Root


On this page

Summary

Calculate the square root of a number.

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>√ = </p>

Data:

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

Output:

<p>√25 = 5.00</p>

Calculate Distance

<p>Distance:  units</p>

Data:

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

Output:

<p>Distance: 5.00 units</p>

Standard Deviation Component

<p>Std Dev: </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