randbits overloads

Synopses

Declared in <random.h>

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

template<int Bits>
uint64_t
randbits() noexcept;

Generate a random (bits)‐bit integer.

uint64_t
randbits(int bits) noexcept;

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

Name

Description

bits

The number of random bits to produce (0 to 64).

Created with MrDocs