absl::uniform_real_distribution

This distribution produces random floating-point values uniformly distributed over the half-open interval [a, b).]

Synopsis

Declared in <absl/random/uniform_real_distribution.h>

template<typename RealType = double>
class uniform_real_distribution;

Description

Example:

absl::BitGen gen;

// Use the distribution to produce a value between 0.0 (inclusive) // and 1.0 (exclusive). double value = absl::uniform_real_distribution<double>(0, 1)(gen);

Types

NameDescription
param_type The parameter set of the distribution.

Type Aliases

NameDescription
result_type The type of the values produced by the distribution.

Member Functions

NameDescription
uniform_real_distribution [constructor]Constructors
a Returns the lower bound of the interval.
b Returns the upper bound of the interval.
max Returns the largest value the distribution can produce.
min Returns the smallest value the distribution can produce.
operator() Function call operators
param param overloads
reset Resets the uniform real distribution.

Friends

NameDescription
absl::operator!=Compares two distributions for inequality.
absl::operator==Compares two distributions for equality.