Back
decrement-exact (clj)
(source)function
(decrement-exact a)
Returns a decremented by 1, throws ArithmeticException on overflow.
See: https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#decrementExact-long-
Examples
clojure
(ns clojure.test-clojure.math
(:require
[clojure.test :refer :all]
[clojure.math :as m]))
(deftest test-decrement-exact
(try
(m/decrement-exact Long/MIN_VALUE)
(is false)
(catch ArithmeticException _
(is true))))