ClojureDocs

Nav

Namespaces

floor

clojure.math

Available since 1.11
  • (floor a)
Returns the largest double less than or equal to a, and equal to a
mathematical integer.
If a is ##NaN or ##Inf or ##-Inf or already equal to an integer => a
If a is less than zero but greater than -1.0 => -0.0
See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#floor-double-
1 Example
(math/floor 42.1)
;; => 42.0

(math/floor 42.8)
;; => 42.0

(math/floor -42.1)
;; => -43.0

(math/floor -42.8)
;; => -43.0
See Also
No see-alsos for clojure.math/floor
0 Notes
No notes for floor