diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2014-08-18 15:50:42 -0400 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2014-08-18 17:46:18 -0400 |
| commit | c88feffde4f5043adf07a6837026f228e20b67e6 (patch) | |
| tree | 7acb0fd75602798e5245bd2fb676db7c73f1a1fa | |
| parent | f8a9211740561b1e177e5e36c1b1a6ce923492e8 (diff) | |
Make comment about small bias in %.
Fixes #16354.
| -rw-r--r-- | src/doc/guide.md | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/doc/guide.md b/src/doc/guide.md index 194205c561e..f6fa57fe143 100644 --- a/src/doc/guide.md +++ b/src/doc/guide.md @@ -1894,7 +1894,8 @@ Also, you may wonder why we are using `%` on the result of `rand::random()`. This operator is called 'modulo', and it returns the remainder of a division. By taking the modulo of the result of `rand::random()`, we're limiting the values to be between 0 and 99. Then, we add one to the result, making it from 1 -to 100. +to 100. Using modulo can give you a very, very small bias in the result, but +for this example, it is not important. Let's try to compile this using `cargo build`: |
