A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.com/random_device below:

class

<random>

std::random_device

True random number generator

A random number generator that produces non-deterministic random numbers, if supported.

Unlike the other standard generators, this is not meant to be an engine that generates pseudo-random numbers, but a generator based on stochastic processes to generate a sequence of uniformly distributed random numbers. Although, certain library implementations may lack the ability to produce such numbers and employ a random number engine to generate pseudo-random values instead. In this case, entropy returns zero.

Notice that random devices may not always be available to produce random numbers (and in some systems, they may even never be available). This is signaled by throwing an exception derived from the standard exception on construction or when a number is requested with operator().

Unless the program really requires a stochastic process to generate random numbers, a portable program is encouraged to use an alternate pseudo-random number generator engine instead, or at least provide a recovery method for such exceptions.



Member types The following alias is a member type of random_device:

member type definition notes result_type unsigned int The type of the numbers generated.


Member functions
(constructor)
Construct random device (public member function)
min
Minimum value (public static member function)
max
Maximum value (public static member function)
operator()
Generate random number (public member function)
entropy
Return entropy (public member function)

See also
linear_congruential_engine
Linear congruential random number engine (class template)
mersenne_twister_engine
Mersenne twister random number engine (class template)
subtract_with_carry_engine
Subtract-with-carry random number engine (class template)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4