You're viewing version 1.2.0 of unchecked-inc. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16

unchecked-inc

clojure.core

  • (unchecked-inc x)
Returns a number one greater than x, an int or long.
Note - uses a primitive operator subject to overflow.

1 Example top

  • users=> (unchecked-inc Integer/MAX_VALUE)
    -2147483648
    
    users=> (unchecked-inc 0)
    1
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:934 top

(defn unchecked-inc
  "Returns a number one greater than x, an int or long.
  Note - uses a primitive operator subject to overflow."
  {:inline (fn [x] `(. clojure.lang.Numbers (unchecked_inc ~x)))
   :added "1.0"}
  [x] (. clojure.lang.Numbers (unchecked_inc x)))
Vars in clojure.core/unchecked-inc: defn
Used in 3 other vars dotimes amap areduce

Comments top

No comments for unchecked-inc. Log in to add a comment.