#
A uniform_int_distribution random number distribution produces random integers i, a  ≤ i  ≤ b, distributed according to the constant discrete probability function in Formula 29.2.
namespace std { template<class IntType = int> class uniform_int_distribution { public: / types using result_type = IntType; using param_type = unspecified; / constructors and reset functions uniform_int_distribution() : uniform_int_distribution(0) {} explicit uniform_int_distribution(IntType a, IntType b = numeric_limits<IntType>::max(); explicit uniform_int_distribution(const param_type& parm); void reset(); / equality operators friend bool operator=(const uniform_int_distribution& x, const uniform_int_distribution& y); / generating functions template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); / property functions result_type a() const; result_type b() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; / inserters and extractors template<class charT, class traits> friend basic_ostream<charT, traits>& operator<(basic_ostream<charT, traits>& os, / hosted const uniform_int_distribution& x); template<class charT, class traits> friend basic_istream<charT, traits>& operator>(basic_istream<charT, traits>& is, / hosted uniform_int_distribution& x); }; }
explicit uniform_int_distribution(IntType a, IntType b = numeric_limits<IntType>::max();
Remarks: a and b correspond to the respective parameters of the distribution.
result_type a() const;
Returns: The value of the a parameter with which the object was constructed.
result_type b() const;
Returns: The value of the b parameter with which the object was constructed.

29.5.9.2.2 Class template uniform_real_distribution [rand.dist.uni.real]

A uniform_real_distribution random number distribution produces random numbers x,
[Note 1: 
This implies that p(x|a,b) is undefined when a == b.
— end note]
namespace std { template<class RealType = double> class uniform_real_distribution { public: / types using result_type = RealType; using param_type = unspecified; / constructors and reset functions uniform_real_distribution() : uniform_real_distribution(0.0) {} explicit uniform_real_distribution(RealType a, RealType b = 1.0); explicit uniform_real_distribution(const param_type& parm); void reset(); / equality operators friend bool operator=(const uniform_real_distribution& x, const uniform_real_distribution& y); / generating functions template<class URBG> result_type operator()(URBG& g); template<class URBG> result_type operator()(URBG& g, const param_type& parm); / property functions result_type a() const; result_type b() const; param_type param() const; void param(const param_type& parm); result_type min() const; result_type max() const; / inserters and extractors template<class charT, class traits> friend basic_ostream<charT, traits>& operator<(basic_ostream<charT, traits>& os, const uniform_real_distribution& x); template<class charT, class traits> friend basic_istream<charT, traits>& operator>(basic_istream<charT, traits>& is, uniform_real_distribution& x); }; }
explicit uniform_real_distribution(RealType a, RealType b = 1.0);
Preconditions: a  ≤ b and
Remarks: a and b correspond to the respective parameters of the distribution.
result_type a() const;
Returns: The value of the a parameter with which the object was constructed.
result_type b() const;
Returns: The value of the b parameter with which the object was constructed.

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