Purely functional and splittable pseudo-random number generators.
Purely functional and splittable pseudo-random number generators.
(rand-double rng)
Returns a random double between 0.0 (inclusive) and 1.0 (exclusive) based on the given immutable RNG.
Note: to maintain independence you should not call more than one function in the IRandom protocol with the same argument
Returns a random double between 0.0 (inclusive) and 1.0 (exclusive) based on the given immutable RNG. Note: to maintain independence you should not call more than one function in the IRandom protocol with the same argument
(rand-long rng)
Returns a random long based on the given immutable RNG.
Note: to maintain independence you should not call more than one function in the IRandom protocol with the same argument
Returns a random long based on the given immutable RNG. Note: to maintain independence you should not call more than one function in the IRandom protocol with the same argument
Returns a random goog.math.Long based on the given immutable RNG.
Note: to maintain independence you should not call more than one function in the IRandom protocol with the same argument
Returns a random goog.math.Long based on the given immutable RNG. Note: to maintain independence you should not call more than one function in the IRandom protocol with the same argument
(split rng)
Returns two new RNGs [rng1 rng2], which should generate sufficiently independent random data.
Note: to maintain independence you should not call more than one function in the IRandom protocol with the same argument
Returns two new RNGs [rng1 rng2], which should generate sufficiently independent random data. Note: to maintain independence you should not call more than one function in the IRandom protocol with the same argument
(split-n rng n)
Returns a collection of n
RNGs, which should generate
sufficiently independent random data.
Note: to maintain independence you should not call more than one function in the IRandom protocol with the same argument
Returns a collection of `n` RNGs, which should generate sufficiently independent random data. Note: to maintain independence you should not call more than one function in the IRandom protocol with the same argument
(make-java-util-splittable-random seed)
(make-random)
(make-random seed)
Given an optional Long seed, returns an object that satisfies the IRandom protocol.
Given an optional Long seed, returns an object that satisfies the IRandom protocol.
Given an optional integer (or goog.math.Long) seed, returns an implementation of the IRandom protocol.
Given an optional integer (or goog.math.Long) seed, returns an implementation of the IRandom protocol.
cljdoc builds & hosts documentation for Clojure/Script libraries
Ctrl+k | Jump to recent docs |
← | Move to previous article |
→ | Move to next article |
Ctrl+/ | Jump to the search field |