store/[org.clojure/clojure "1.8.0"] clj::clojure.core/unchecked-subtract

Official Documentation

Add notes
Arities
==================================================
   [x y]

Docstring
==================================================
  Returns the difference of x and y, both long.
  Note - uses a primitive operator subject to overflow.

Source

(defn unchecked-subtract
  "Returns the difference of x and y, both long.
  Note - uses a primitive operator subject to overflow."
  {:inline (fn [x y] `(. clojure.lang.Numbers (unchecked_minus ~x ~y)))
   :added "1.0"}
  [x y] (. clojure.lang.Numbers (unchecked_minus x y)))

Example 1

Edit
;; can't interchange INTs with LONGs, only F(int, int) or F(long, long)
;; F is a function, not an
;; overflow very easily as shown below.

(unchecked-subtract Long/MIN_VALUE 5555555554)
;; => 9223372031299220254

(unchecked-subtract Long/MIN_VALUE 1)
;; => java.lang.IllegalArgumentException: No matching method found: unchecked_subtract (NO_SOURCE_FILE:0)

(unchecked-subtract Long/MIN_VALUE Long/MIN_VALUE)
;; => 0

(unchecked-subtract Integer/MIN_VALUE Long/MIN_VALUE)
;; => java.lang.IllegalArgumentException: No matching method found: unchecked_subtract (NO_SOURCE_FILE:0)

(unchecked-subtract Integer/MIN_VALUE Integer/MIN_VALUE)
;; => 0

(unchecked-subtract Integer/MIN_VALUE 0)
;; => -2147483648

(unchecked-subtract Integer/MIN_VALUE 1)
;; => 2147483647

(unchecked-subtract Integer/MIN_VALUE 54444444)
;; => 2093039204

(unchecked-subtract 123456 654321)
;; => -530865

Uses on crossclj