A RetroSearch Logo

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

Search Query:

Showing content from https://cplusplus.com/reference/random/random_device/min/ below:

public static member function

<random>

std::random_device::min
static constexpr result_type min();

Minimum value

Returns the minimum value potentially returned by member operator(), which for random_device is always zero.

Parameters none

Return value zero
result_type is a member type, defined as an alias of unsigned int.

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// random_device example
#include <iostream>
#include <random>

int main ()
{
  std::random_device rd;

  std::cout << "default random_device characteristics:" << std::endl;
  std::cout << "minimum: " << rd.min() << std::endl;
  std::cout << "maximum: " << rd.max() << std::endl;
  std::cout << "entropy: " << rd.entropy() << std::endl;
  std::cout << "a random number: " << rd() << std::endl;

  return 0;
}

Possible output:
default random_device characteristics:
minimum: 0
maximum: 4294967295
entropy: 32
a random number: 1243119146


See also
random_device::max
Maximum value (public static member function)
random_device::entropy
Return entropy (public member function)

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