ClojureDocs

Nav

Namespaces

+

clojure.core

Available since 1.2 (source)
  • (+)
  • (+ x)
  • (+ x y)
  • (+ x y & more)
Returns the sum of nums. (+) returns 0. Does not auto-promote
longs, will throw on overflow. See also: +'
1 Example
(+)
;;=> 0

(+ 1)
;;=> 1

(+ -10)
;;=> -10

(+ 1 2)
;;=> 3

(+ 1 2 3)
;;=> 6

(+ 1/2 1/2)
;;=> 1N

(apply + (range 10000000000000 10000000001000))
;; ArithmeticException: integer overflow
See Also

Returns the sum of nums. (+') returns 0. Supports arbitrary precision. See also: +

Added by jafingerhut

Returns the product of nums. (*) returns 1. Does not auto-promote longs, will throw on overflow. S...

Added by Havvy

If no ys are supplied, returns the negation of x, else subtracts the ys from x and returns the res...

Added by Havvy

Returns the sum of x and y, both long. Note - uses a primitive operator subject to overflow.

Added by Dimagog

Returns a number one greater than num. Does not auto-promote longs, will throw on overflow. See al...

Added by NealEhardt
0 Notes
No notes for +