#
An independent_bits_engine random number engine adaptor combines random numbers that are produced by some base engine e, so as to produce random numbers with a specified number of bits w.
The state x
2
#
The transition and generation algorithms are described in terms of the following integral constants:
  • Let
  • With n as determined below, let
  • Let
    Otherwise let
[Note 1: 
The relation
— end note]
The transition algorithm is carried out by invoking e() as often as needed to obtain
The generation algorithm uses the values produced while advancing the state as described above to yield a quantity S obtained as if by the following algorithm: S = 0; for (k = 0;
namespace std { template<class Engine, size_t w, class UIntType> class independent_bits_engine { public: / types using result_type = UIntType; / engine characteristics static constexpr result_type min() { return 0; } static constexpr result_type max() { return
The following relations shall hold: 0 < w and w <= numeric_limits<result_type>​::​digits.
The textual representation consists of the textual representation of e.

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant