elasticsearch/docs/reference/query-languages/esql/_snippets/functions/examples/pow.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
602 B
Markdown
Raw Normal View History

% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
**Examples**
```esql
ROW base = 2.0, exponent = 2
| EVAL result = POW(base, exponent)
```
| base:double | exponent:integer | result:double |
| --- | --- | --- |
| 2.0 | 2 | 4.0 |
The exponent can be a fraction, which is similar to performing a root.
For example, the exponent of `0.5` will give the square root of the base:
```esql
ROW base = 4, exponent = 0.5
| EVAL s = POW(base, exponent)
```
| base:integer | exponent:double | s:double |
| --- | --- | --- |
| 4 | 0.5 | 2.0 |