mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-29 01:44:36 -04:00
When you divide two integers or two longs we round towards 0. Like Postgres or Java or Rust or C. Other systems, like MySQL or SPL or Javascript or Python always produce a floating point number. We should warn folks about this. It's genuinely unexpected for some folks. OTOH, converting into a floating point number would be unexpected for other folks. Oh well, let's document what we've got.
77 lines
1.8 KiB
Text
77 lines
1.8 KiB
Text
[discrete]
|
|
[[esql-binary-operators]]
|
|
=== Binary operators
|
|
|
|
[[esql-binary-operators-equality]]
|
|
==== Equality
|
|
[.text-center]
|
|
image::esql/functions/signature/equals.svg[Embedded,opts=inline]
|
|
|
|
Supported types:
|
|
|
|
include::types/equals.asciidoc[]
|
|
|
|
==== Inequality `!=`
|
|
[.text-center]
|
|
image::esql/functions/signature/not_equals.svg[Embedded,opts=inline]
|
|
|
|
Supported types:
|
|
|
|
include::types/not_equals.asciidoc[]
|
|
|
|
==== Less than `<`
|
|
[.text-center]
|
|
image::esql/functions/signature/less_than.svg[Embedded,opts=inline]
|
|
|
|
include::types/less_than.asciidoc[]
|
|
|
|
==== Less than or equal to `<=`
|
|
[.text-center]
|
|
image::esql/functions/signature/less_than_or_equal.svg[Embedded,opts=inline]
|
|
|
|
include::types/less_than_or_equal.asciidoc[]
|
|
|
|
==== Greater than `>`
|
|
[.text-center]
|
|
image::esql/functions/signature/greater_than.svg[Embedded,opts=inline]
|
|
|
|
include::types/greater_than.asciidoc[]
|
|
|
|
==== Greater than or equal to `>=`
|
|
[.text-center]
|
|
image::esql/functions/signature/greater_than_or_equal.svg[Embedded,opts=inline]
|
|
|
|
include::types/greater_than_or_equal.asciidoc[]
|
|
|
|
==== Add `+`
|
|
[.text-center]
|
|
image::esql/functions/signature/add.svg[Embedded,opts=inline]
|
|
|
|
include::types/add.asciidoc[]
|
|
|
|
==== Subtract `-`
|
|
[.text-center]
|
|
image::esql/functions/signature/sub.svg[Embedded,opts=inline]
|
|
|
|
include::types/sub.asciidoc[]
|
|
|
|
==== Multiply `*`
|
|
[.text-center]
|
|
image::esql/functions/signature/mul.svg[Embedded,opts=inline]
|
|
|
|
include::types/mul.asciidoc[]
|
|
|
|
==== Divide `/`
|
|
[.text-center]
|
|
image::esql/functions/signature/div.svg[Embedded,opts=inline]
|
|
|
|
NOTE: Division of two integer types will yield an integer result, rounding towards 0.
|
|
If you need floating point division, <<esql-cast-operator>> one of the arguments to a `DOUBLE`.
|
|
|
|
include::types/div.asciidoc[]
|
|
|
|
==== Modulus `%`
|
|
[.text-center]
|
|
image::esql/functions/signature/mod.svg[Embedded,opts=inline]
|
|
|
|
include::types/mod.asciidoc[]
|