• (abs n)
(abs n) is the absolute value of n

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/math.clj:122 top

(defn abs "(abs n) is the absolute value of n" [n]
  (cond
   (not (number? n)) (throw (IllegalArgumentException.
			     "abs requires a number"))
   (neg? n) (- n)
   :else n))
Vars in clojure.contrib.math/abs: - cond defn neg? not number?
Used in 0 other vars

Comments top

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