std::bernoulli_distribution (3) - Linux Manuals
std::bernoulli_distribution: std::bernoulli_distribution
NAME
std::bernoulli_distribution - std::bernoulli_distribution
Synopsis
Defined in header <random>
class bernoulli_distribution; (since C++11)
Produces random boolean values, according to the discrete probability function. The probability of true is
std::bernoulli_distribution satisfies RandomNumberDistribution
Member types
Member type Definition
result_type bool
param_type the type of the parameter set, see RandomNumberDistribution.
Member functions
constructor (public member function)
reset (public member function)
Generation
operator() (public member function)
Characteristics
p (public member function)
param (public member function)
min (public member function)
max (public member function)
Non-member functions
operator== (function)
operator!=
operator<< (function template)
operator>>
Example
// Run this code
Possible output:
External links
Weisstein,_Eric_W._"Bernoulli_Distribution." From MathWorld--A Wolfram Web Resource.