Back to Elasticsearch

Pow

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

9.4.0599 B
Original Source

% This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.

Examples

esql
ROW base = 2.0, exponent = 2
| EVAL result = POW(base, exponent)
base:doubleexponent:integerresult:double
2.024.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:integerexponent:doubles:double
40.52.0