mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-30 10:23:41 -04:00
* Functions E-Z * Incorporate changes from #103686 * More functions * More functions * Update docs/reference/esql/functions/floor.asciidoc Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com> * Update docs/reference/esql/functions/left.asciidoc Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Alexander Spies <alexander.spies@elastic.co> * Review feedback * Fix geo_shape description * Change 'colum'/'field' into 'expressions' * Review feedback * One more --------- Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com> Co-authored-by: Alexander Spies <alexander.spies@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
49 lines
1.1 KiB
Text
49 lines
1.1 KiB
Text
[discrete]
|
|
[[esql-pow]]
|
|
=== `POW`
|
|
|
|
*Syntax*
|
|
|
|
[.text-center]
|
|
image::esql/functions/signature/pow.svg[Embedded,opts=inline]
|
|
|
|
*Parameters*
|
|
|
|
`base`::
|
|
Numeric expression. If `null`, the function returns `null`.
|
|
|
|
`exponent`::
|
|
Numeric expression. If `null`, the function returns `null`.
|
|
|
|
*Description*
|
|
|
|
Returns the value of `base` raised to the power of `exponent`. Both arguments
|
|
must be numeric. The output is always a double. Note that it is still possible
|
|
to overflow a double result here; in that case, null will be returned.
|
|
|
|
*Supported types*
|
|
|
|
include::types/pow.asciidoc[]
|
|
|
|
*Examples*
|
|
|
|
[source.merge.styled,esql]
|
|
----
|
|
include::{esql-specs}/math.csv-spec[tag=powDI]
|
|
----
|
|
[%header.monospaced.styled,format=dsv,separator=|]
|
|
|===
|
|
include::{esql-specs}/math.csv-spec[tag=powDI-result]
|
|
|===
|
|
|
|
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:
|
|
|
|
[source.merge.styled,esql]
|
|
----
|
|
include::{esql-specs}/math.csv-spec[tag=powID-sqrt]
|
|
----
|
|
[%header.monospaced.styled,format=dsv,separator=|]
|
|
|===
|
|
include::{esql-specs}/math.csv-spec[tag=powID-sqrt-result]
|
|
|===
|