floor.asciidoc 759 B

123456789101112131415161718192021222324252627282930313233343536
  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. *Supported types*
  16. include::types/floor.asciidoc[]
  17. *Example*
  18. [source.merge.styled,esql]
  19. ----
  20. include::{esql-specs}/math.csv-spec[tag=floor]
  21. ----
  22. [%header.monospaced.styled,format=dsv,separator=|]
  23. |===
  24. include::{esql-specs}/math.csv-spec[tag=floor-result]
  25. |===