Skip to content

Commit

Permalink
clean up docs and examples a bit more
Browse files Browse the repository at this point in the history
  • Loading branch information
not-napoleon committed Nov 16, 2023
1 parent bc471a2 commit 7d55e93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 26 deletions.
24 changes: 2 additions & 22 deletions docs/reference/esql/functions/pow.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
image::esql/functions/signature/pow.svg[Embedded,opts=inline]

Returns the value of a base (first argument) raised to the power of an exponent (second argument).
Both arguments must be numeric. The output is always a double.
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.

[source.merge.styled,esql]
----
Expand All @@ -17,27 +18,6 @@ include::{esql-specs}/math.csv-spec[tag=powDI-result]
|===


[discrete]
==== Arithmetic errors

Arithmetic errors and numeric overflow do not result in an error. Instead, the result will be `null`
and a warning for the `ArithmeticException` added.
For example:

[source.merge.styled,esql]
----
include::{esql-specs}/math.csv-spec[tag=powULOverrun]
----
[%header.monospaced.styled,format=dsv,separator=|]
|===
include::{esql-specs}/math.csv-spec[tag=powULOverrun-warning]
|===
[%header.monospaced.styled,format=dsv,separator=|]
|===
include::{esql-specs}/math.csv-spec[tag=powULOverrun-result]
|===


[discrete]
==== Fractional exponents

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,16 +357,12 @@ base:double | exponent:integer | result:double
;

powIntInt
// tag::powII[]
ROW base = 2, exponent = 2
| EVAL s = POW(base, exponent)
// end::powII[]
;

// tag::powII-result[]
base:integer | exponent:integer | s:double
2 | 2 | 4.0
// end::powII-result[]
;

powIntIntPlusInt
Expand Down

0 comments on commit 7d55e93

Please sign in to comment.