* Add degrees annotations to examples Signed-off-by: Nick Cameron <nrc@ncameron.org> * Fix a units bug with the modulo operation Signed-off-by: Nick Cameron <nrc@ncameron.org> --------- Signed-off-by: Nick Cameron <nrc@ncameron.org>
47 lines
82 KiB
Markdown
47 lines
82 KiB
Markdown
---
|
|
title: "pow"
|
|
subtitle: "Function in std::math"
|
|
excerpt: "Compute the number to a power."
|
|
layout: manual
|
|
---
|
|
|
|
Compute the number to a power.
|
|
|
|
```kcl
|
|
pow(
|
|
@input: number,
|
|
exp: number(_),
|
|
): number
|
|
```
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
| Name | Type | Description | Required |
|
|
|----------|------|-------------|----------|
|
|
| `input` | [`number`](/docs/kcl-std/types/std-types-number) | The number to raise. | Yes |
|
|
| `exp` | [`number(_)`](/docs/kcl-std/types/std-types-number) | The power to raise to. | Yes |
|
|
|
|
### Returns
|
|
|
|
[`number`](/docs/kcl-std/types/std-types-number) - A number.
|
|
|
|
|
|
### Examples
|
|
|
|
```kcl
|
|
exampleSketch = startSketchOn(XZ)
|
|
|> startProfile(at = [0, 0])
|
|
|> angledLine(angle = 50deg, length = pow(5, exp = 2))
|
|
|> yLine(endAbsolute = 0)
|
|
|> close()
|
|
|
|
example = extrude(exampleSketch, length = 5)
|
|
|
|
```
|
|
|
|

|
|
|
|
|