floor.asciidoc 739 B

12345678910111213141516171819202122232425262728293031323334
  1. [discrete]
  2. [[esql-floor]]
  3. === `FLOOR`
  4. *Syntax*
  5. [.text-center]
  6. image::esql/functions/signature/floor.svg[Embedded,opts=inline]
  7. *Parameters*
  8. `n`::
  9. Numeric expression. If `null`, the function returns `null`.
  10. *Description*
  11. Rounds a number down to the nearest integer.
  12. NOTE: This is a noop for `long` (including unsigned) and `integer`.
  13. For `double` this picks the closest `double` value to the integer
  14. similar to {javadoc}/java.base/java/lang/Math.html#floor(double)[Math.floor].
  15. include::types/floor.asciidoc[]
  16. *Example*
  17. [source.merge.styled,esql]
  18. ----
  19. include::{esql-specs}/math.csv-spec[tag=floor]
  20. ----
  21. [%header.monospaced.styled,format=dsv,separator=|]
  22. |===
  23. include::{esql-specs}/math.csv-spec[tag=floor-result]
  24. |===