Produces a floating point value from a Gaussian (Normal) distribution.
Declared in <absl/random/distributions.h>
template<
typename RealType,
typename URBG>
RealType
Gaussian(
URBG&& urbg,
RealType mean = 0,
RealType stddev = 1);
absl::Gaussian produces a floating point number selected from the Gaussian (ie. "Normal") distribution. T must be a floating point type, but may be inferred from the types of mean and stddev.
See https://en.wikipedia.org/wiki/Normal_distribution
Example:
absl::BitGen bitgen; ... double giraffe_height = absl::Gaussian(bitgen, 16.3, 3.3);
A random value drawn from the Gaussian distribution.
| Name | Description |
|---|---|
| urbg | The uniform random bit generator. |
| mean | The mean of the distribution. |
| stddev | The standard deviation of the distribution. |