Back
floor-div (clj)
(source)function
(floor-div x y)
Integer division that rounds to negative infinity (as opposed to zero).
The special case (floorDiv Long/MIN_VALUE -1) overflows and returns Long/MIN_VALUE.
See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#floorDiv-long-long-
Examples
clojure
(ns clojure.test-clojure.math
(:require
[clojure.test :refer :all]
[clojure.math :as m]))
(deftest test-floor-div
(is (= Long/MIN_VALUE (m/floor-div Long/MIN_VALUE -1)))
(is (= -1 (m/floor-div -2 5))))