RandomMixin::randbits

randbits overloads

Synopses

Declared in <random.h>

Same as above, but with compile-time fixed bits count.

template<int Bits>
uint64_t
randbits() noexcept;
» more...

Generate a random (bits)-bit integer.

uint64_t
randbits(int bits) noexcept;
» more...

Return Value

  • A random integer whose low Bits bits are random and the rest zero.
  • A random integer whose low bits bits are random and the rest zero.

Parameters

NameDescription
bitsThe number of random bits to produce (0 to 64).