std::binomi...ution::param(3)
π NAME π
okay bestie, you're on the std::binomi...ution::param(3) page of the C++ Standard Libary manual β yes, that's the title and the manual name folded in near the top, we're not copy-pasting the header line, we're vibing β¨
std::binomial_distribution::param-std::binomial_distribution::paramβ that's the name, twice, because the page said so and we respect the page π
β¨ Synopsis β¨
param_type param() const; (1) (since C++11)
void param( const param_type& params ); (2) (since C++11)
The way that this whole thing manages the associated distribution parameter set? iconic. no cap.
- Returns the associated parameter set. π«Ά
- Sets the associated parameter set to
params. π
π Parameters π
paramsβ new contents of the associated parameter set πΈ
π¦ Return value π¦
- The associated parameter set.
- (none)
β Complexity β
Constant. literally constant, bestie, that's the whole vibe.
π Example π
run this code, it's giving random binomial realness π
// Run this code
#include <iostream>
#include <random>
int main()
{
std::random_device rd;
std::mt19937 gen(rd());
using BinomialDist = std::binomial_distribution<>;
BinomialDist bino_dis(1, 0.5);
std::cout << "A sample of Binomial( 1, 0.5): " << bino_dis(gen) <<
'\n';
// Use another parameter set
bino_dis.param(BinomialDist::param_type(100,0.9));
std::cout << "A sample of Binomial(100, 0.9): " << bino_dis(gen) <<
'\n';
}
Possible output:
A sample of Binomial( 1, 0.5): 0
A sample of Binomial(100, 0.9): 94
and that's the page, bestie π«Ά the footer shoutout goes to http://cppreference.com, the date/version 2024.06.10, and the icon herself: std::binomi...ution::param(3) π
β¨
π¦ 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