Arities ================================================== [n] Docstring ================================================== Returns a random integer between 0 (inclusive) and n (exclusive).
Arities ================================================== [n] Docstring ================================================== Returns a random integer between 0 (inclusive) and n (exclusive).
(defn rand-int
"Returns a random integer between 0 (inclusive) and n (exclusive)."
{:added "1.0"
:static true}
[n] (int (rand n)))
(rand-int 30)
;; => 10
(rand-int 30)
;; => 7
;; compare with
(int (rand 30))
;; => 17