* Add documentation to modules, and some constants and types Signed-off-by: Nick Cameron <nrc@ncameron.org> * Improve the language reference Signed-off-by: Nick Cameron <nrc@ncameron.org> --------- Signed-off-by: Nick Cameron <nrc@ncameron.org>
45 lines
84 KiB
Markdown
45 lines
84 KiB
Markdown
---
|
|
title: "sqrt"
|
|
subtitle: "Function in std::math"
|
|
excerpt: "Compute the square root of a number."
|
|
layout: manual
|
|
---
|
|
|
|
Compute the square root of a number.
|
|
|
|
```kcl
|
|
sqrt(@input: number): number
|
|
```
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `input` | [`number`](/docs/kcl-std/types/std-types-number) | A number. | Yes |
|
|
|
|
### Returns
|
|
|
|
[`number`](/docs/kcl-std/types/std-types-number) - A number.
|
|
|
|
|
|
### Examples
|
|
|
|
```kcl
|
|
exampleSketch = startSketchOn(XZ)
|
|
|> startProfile(at = [0, 0])
|
|
|> angledLine(
|
|
angle = 50,
|
|
length = sqrt(2500),
|
|
)
|
|
|> yLine(endAbsolute = 0)
|
|
|> close()
|
|
|
|
example = extrude(exampleSketch, length = 5)
|
|
```
|
|
|
|

|
|
|
|
|