tmp/tmpgpvbqsu_/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### Low-quality random number generation <a id="c.math.rand">[[c.math.rand]]</a>
|
| 2 |
+
|
| 3 |
+
[*Note 1*: The header `<cstdlib>` ([[cstdlib.syn]]) declares the
|
| 4 |
+
functions described in this subclause. — *end note*]
|
| 5 |
+
|
| 6 |
+
``` cpp
|
| 7 |
+
int rand();
|
| 8 |
+
void srand(unsigned int seed);
|
| 9 |
+
```
|
| 10 |
+
|
| 11 |
+
*Effects:* The `rand` and `srand` functions have the semantics specified
|
| 12 |
+
in the C standard library.
|
| 13 |
+
|
| 14 |
+
*Remarks:* The implementation may specify that particular library
|
| 15 |
+
functions may call `rand`. It is *implementation-defined* whether the
|
| 16 |
+
`rand` function may introduce data races ([[res.on.data.races]]).
|
| 17 |
+
|
| 18 |
+
[*Note 1*: The other random number generation facilities in this
|
| 19 |
+
International Standard ([[rand]]) are often preferable to `rand`,
|
| 20 |
+
because `rand`’s underlying algorithm is unspecified. Use of `rand`
|
| 21 |
+
therefore continues to be non-portable, with unpredictable and
|
| 22 |
+
oft-questionable quality and performance. — *end note*]
|
| 23 |
+
|
| 24 |
+
ISO C 7.22.2
|
| 25 |
+
|