std::geomet...distribution(3)
okay so bestie, welcome to std::geomet...distribution(3) from the C++ Standard Libary manual β yes, βLibaryβ is literally how itβs spelled in the header, iykyk ππ
. This page is all about the constructors for std::geometric_distribution, and itβs giving βshort but spicyβ. Letβs get into it. β¨
πΈ NAME πΈ
std::geometric_distribution::geometric_distribution-std::geometric_distribution::geometric_distribution
π Synopsis π
geometric_distribution() : geometric_distribution(0.5) {} (1)
(since C++11)
explicit geometric_distribution( double p ); (2)
(since C++11)
explicit geometric_distribution( const param_type& params ); (3)
(since C++11)
So what does it do? It constructs a new distribution object. π
- Uses
pas the distribution parameter. - Uses
paramsas the distribution parameter.
lowkey the default one (1) delegates to geometric_distribution(0.5) β thatβs literally in the synopsis above, bestie. π
π Parameters π
pβ thepdistribution parameter (probability of a trial generating true)paramsβ the distribution parameter set
π§ Notes π§
β οΈ Requires that 0 < p < 1. periodt. No sneaky out-of-range values, okay? π«Ά
π Defect reports π
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
- DR:
P0935R0 - Applied to: C++11
- Behavior as published: default constructor was explicit
- Correct behavior: made implicit
mwah π this page came from http://cppreference.com, dated 2024.06.10, and the footer literally reads std::geomet...distribution(3). slay, you made it to the end. ππ¦π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms