50 lines
1.1 KiB
Plaintext
50 lines
1.1 KiB
Plaintext
[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]
|
|
|===
|