cljs.math/floor
function | since v1.11.50 | Edit |
(floor a)
Source docstring:
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
Note that if a is `nil` then an exception will be thrown. This matches Clojure, rather than js/Math.floor
See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor
(defn ^number floor
{:added "1.11.10"}
[a]
(if (some? a)
(Math/floor a)
(throw (ex-info "Unexpected Null passed to floor" {:fn "floor"}))))