Operations:
fun random-int32 fun random-int32std/num/random/random-int32: () -> random int32.
Pseudo random number using sfc32 by Chris Doty-Humphrey. It is a “chaotic” pseudo random generator that uses 32-bit operations only (so we can be deterministic across architectures in results and performance). It has good statistical properties and passes PractRand and Big-crush. It uses a 32-bit counter to guarantee a worst-case cycle of 232. It has a 96-bit state, so the average period is 2127. The chance of a cycle of less than 2(32+max(96-k,0)) is 2-(32+k), (e.g. the chance of a cycle of less than 248 is 2-80). https://pracrand.sourceforge.net/RNG_engines.txt.
Automatically generated. Retrieves the rnd
constructor field of the sfc-resultstd/num/random/sfc-result: V
type.
Automatically generated. Retrieves the rstate
constructor field of the sfc-resultstd/num/random/sfc-result: V
type.
Returns one of its arguments x
or y
based on a non-deterministic choice.
Use pseudo random numbers given some initial seed
. At most
64-bits of the initial seed are used. Do not use this for
cryptographic applications (use strong-randomstd/num/random/strong-random: forall<a,e> (action : () -> <random,ndet|e> a) -> <ndet|e> a
instead).
Uses sfc32 by Chris Doty-Humphrey which is a fast random
number generator with a 128-bit internal state which
passes PractRand and BigCrush. The worst case minimum cycle
is 2^32, where a potential cycle of 248^ has a chance
of 2^-80^.
Return a random boolean.
Return a random float64 in the range [0,1) using 52-bits of randomness.
Return a random integer in the range [-2^31, 231^).
Call the fun random-int32std/num/random/random-int32: () -> random int32
operation of the effect randomstd/num/random/random: (E, V) -> V
.
Return a strong random boolean.
Return a strong random float64std/core/types/float64: V
in the range [0,1) using 52-bits of randomness.
Generate a strong random float64 uniformly distributed in the range [lo, hi).
Return a strong random integer in the range [-2^31, 231^).
Return a strong random int32std/core/types/int32: V
.
Return a strong random int32std/core/types/int32: V
uniformly distributed in the range [lo,hi).
Are the strong random numbers generated from a strong random source? (like /dev/urandom).
Pick random numbers from a the best strong random source in the OS.
(e.g. like /urandom
, arc4random
etc.). Use srandom-is-strongstd/num/random/srandom-is-strong: () -> ndet bool
to test if the
numbers are indeed based on a strong random source.
Random numbers.
.