inc'

added
1.0

ns
clojure.core

type
function

(inc' x)

Returns a number one greater than num. Supports arbitrary precision.
See also: inc

                > (inc' 1)
2

> (inc' 3.14)
4.140000000000001

> (inc' 4/5)
9/5

> (inc' -1)
0

> (inc' -3/2)
-1/2

> (inc' -0.2)
0.8
            
                ;;;; (inc') auto-promotes on integer overflow:

(inc' (Long/MAX_VALUE))
;;=> 9223372036854775808N

;;;; Unlike (inc) which does not:

(inc (Long/MAX_VALUE))
;;=> ArithmeticException integer overflow