#
A subtract_with_carry_engine random number engine produces unsigned integer random numbers.
2
#
The state x
The state x
The state transition is performed as follows:
  • Let
  • Set
    Set c to 1 if
[Note 1: 
This algorithm corresponds to a modular linear function of the form
— end note]
The generation algorithm is given by
namespace std { template<class UIntType, size_t w, size_t s, size_t r> class subtract_with_carry_engine { public: / types using result_type = UIntType; / engine characteristics static constexpr size_t word_size = w; static constexpr size_t short_lag = s; static constexpr size_t long_lag = r; static constexpr result_type min() { return 0; } static constexpr result_type max() { return
The following relations shall hold: 0u < s, s < r, 0 < w, and w <= numeric_limits<UIntType>​::​digits.
The textual representation consists of the values of
explicit subtract_with_carry_engine(result_type value);
Effects: Sets the values of
If
To set the values
Then, to set each
Set
Complexity: Exactly
template<class Sseq> explicit subtract_with_carry_engine(Sseq& q);
Effects: With
If

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