FsRandom


Utility

Provides utility functions.

Functions and values

Function or valueDescription
choose size count
Signature: size:int -> count:int -> GeneratorFunction<int list>

Returns random indices of collections.

chooseOne upper
Signature: upper:int -> GeneratorFunction<int>

Returns a random number less than the specified value.

createRandomState ()
Signature: unit -> PrngState

Creates a random random state.

defaultState
Signature: PrngState

Provides a default random state.

flipCoin probability
Signature: probability:float -> GeneratorFunction<bool>

Returns a random Boolean value with the specified probability.

randomSign ()
Signature: unit -> GeneratorFunction<^a>
Type parameters: ^a

Returns +1 or -1 randomly.

Fork me on GitHub