You're viewing version 1.2.0 of dec. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16
  • (dec x)
Returns a number one less than num.

1 Example top

  • user=> (dec 2)
    1
    
    user=> (dec 2.0)
    1.0
    
    user=> (dec 1)
    0
    
    user=> (dec -1)
    -2
    
Log in to add / edit an example.

See Also top

  • 0
    clojure.core/dec'

    Returns a number one less than num. Supports arbitrary precision. See

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:928 top

(defn dec
  "Returns a number one less than num."
  {:inline (fn [x] `(. clojure.lang.Numbers (dec ~x)))
   :added "1.0"}
  [x] (. clojure.lang.Numbers (dec x)))
Vars in clojure.core/dec: defn

Comments top

No comments for dec. Log in to add a comment.