Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "random-bits"

Index

Functions

Functions

Const randomBits

  • randomBits(prob: number, num?: undefined | number, rnd?: IRandom): IterableIterator<number>
  • Returns an iterator of random bits, with 1's occurring w/ given probability prob (in the [0,1] interval). If num is given, only that many bits will be produced.

    By default, uses system PRNG, but a custom {@link @thi.ng/random#IRandom} impl can be provided via rnd arg.

    Parameters

    • prob: number

      -

    • Optional num: undefined | number

      -

    • Default value rnd: IRandom = SYSTEM

      -

    Returns IterableIterator<number>

Generated using TypeDoc