store/[org.clojure/clojure "1.8.0"] clj::clojure.core/rand

Official Documentation

Add notes
Arities
==================================================
   []
   [n]

Docstring
==================================================
  Returns a random floating point number between 0 (inclusive) and
  n (default 1) (exclusive).

Source

(defn rand
  "Returns a random floating point number between 0 (inclusive) and
  n (default 1) (exclusive)."
  {:added "1.0"
   :static true}
  ([] (. Math (random)))
  ([n] (* n (rand))))

Example 1

Edit
;; Test `rand` never returns `n`:
(some (partial <= 10) (take 100000 (repeatedly (fn [] (int (rand 10))))))
;; => nil

Example 2

Edit
(rand)
;; => 0.17469201779243182

(rand 100)
;; => 49.542391492950834

Uses on crossclj