1.3.0 permalink Arrow_down_16x16
  • (dec x)
Returns a number one less than num. Does not auto-promote
longs, will throw on overflow. See also: dec'

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:1077 top

(defn dec
  "Returns a number one less than num. Does not auto-promote
  longs, will throw on overflow. See also: dec'"
  {:inline (fn [x] `(. clojure.lang.Numbers (~(if *unchecked-math* 'unchecked_dec 'dec) ~x)))
   :added "1.2"}
  [x] (. clojure.lang.Numbers (dec x)))
Vars in clojure.core/dec:
Used in 0 other vars

Comments top

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