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
Data:
doc.Params["model"] = new {
value = 25
};
Output:
<p>√25 = 5.00</p>
Calculate Distance
Data:
doc.Params["model"] = new {
dx = 3,
dy = 4
};
Output:
<p>Distance: 5.00 units</p>
Standard Deviation Component
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