tmp/tmpw3p2jdl9/{from.md → to.md}
RENAMED
|
@@ -1,19 +1,18 @@
|
|
| 1 |
### Class `random_device` <a id="rand.device">[[rand.device]]</a>
|
| 2 |
|
| 3 |
-
A `random_device` uniform random
|
| 4 |
-
|
| 5 |
|
| 6 |
-
If implementation limitations prevent generating
|
| 7 |
-
|
| 8 |
|
| 9 |
``` cpp
|
| 10 |
-
class random_device
|
| 11 |
-
{
|
| 12 |
public:
|
| 13 |
// types
|
| 14 |
-
|
| 15 |
|
| 16 |
// generator characteristics
|
| 17 |
static constexpr result_type min() { return numeric_limits<result_type>::min(); }
|
| 18 |
static constexpr result_type max() { return numeric_limits<result_type>::max(); }
|
| 19 |
|
|
@@ -34,15 +33,15 @@ public:
|
|
| 34 |
|
| 35 |
``` cpp
|
| 36 |
explicit random_device(const string& token = implementation-defined);
|
| 37 |
```
|
| 38 |
|
| 39 |
-
*Effects:* Constructs a `random_device`
|
| 40 |
-
|
| 41 |
-
parameter are implementation-defined.[^3]
|
| 42 |
|
| 43 |
-
*Throws:* A value of an implementation-defined type derived from
|
| 44 |
`exception` if the `random_device` could not be initialized.
|
| 45 |
|
| 46 |
``` cpp
|
| 47 |
double entropy() const noexcept;
|
| 48 |
```
|
|
@@ -53,12 +52,12 @@ returned by `operator()`, in the range `min()` to log₂( `max()`+1).
|
|
| 53 |
|
| 54 |
``` cpp
|
| 55 |
result_type operator()();
|
| 56 |
```
|
| 57 |
|
| 58 |
-
*Returns:* A
|
| 59 |
-
between `min()` and `max()`, inclusive. It is implementation-defined
|
| 60 |
-
these values are generated.
|
| 61 |
|
| 62 |
-
*Throws:* A value of an implementation-defined type derived from
|
| 63 |
`exception` if a random number could not be obtained.
|
| 64 |
|
|
|
|
| 1 |
### Class `random_device` <a id="rand.device">[[rand.device]]</a>
|
| 2 |
|
| 3 |
+
A `random_device` uniform random bit generator produces nondeterministic
|
| 4 |
+
random numbers.
|
| 5 |
|
| 6 |
+
If implementation limitations prevent generating nondeterministic random
|
| 7 |
+
numbers, the implementation may employ a random number engine.
|
| 8 |
|
| 9 |
``` cpp
|
| 10 |
+
class random_device {
|
|
|
|
| 11 |
public:
|
| 12 |
// types
|
| 13 |
+
using result_type = unsigned int;
|
| 14 |
|
| 15 |
// generator characteristics
|
| 16 |
static constexpr result_type min() { return numeric_limits<result_type>::min(); }
|
| 17 |
static constexpr result_type max() { return numeric_limits<result_type>::max(); }
|
| 18 |
|
|
|
|
| 33 |
|
| 34 |
``` cpp
|
| 35 |
explicit random_device(const string& token = implementation-defined);
|
| 36 |
```
|
| 37 |
|
| 38 |
+
*Effects:* Constructs a `random_device` nondeterministic uniform random
|
| 39 |
+
bit generator object. The semantics and default value of the `token`
|
| 40 |
+
parameter are *implementation-defined*. [^3]
|
| 41 |
|
| 42 |
+
*Throws:* A value of an *implementation-defined* type derived from
|
| 43 |
`exception` if the `random_device` could not be initialized.
|
| 44 |
|
| 45 |
``` cpp
|
| 46 |
double entropy() const noexcept;
|
| 47 |
```
|
|
|
|
| 52 |
|
| 53 |
``` cpp
|
| 54 |
result_type operator()();
|
| 55 |
```
|
| 56 |
|
| 57 |
+
*Returns:* A nondeterministic random value, uniformly distributed
|
| 58 |
+
between `min()` and `max()`, inclusive. It is *implementation-defined*
|
| 59 |
+
how these values are generated.
|
| 60 |
|
| 61 |
+
*Throws:* A value of an *implementation-defined* type derived from
|
| 62 |
`exception` if a random number could not be obtained.
|
| 63 |
|