Skip to content

Commit c88feff

Browse files
committed
Make comment about small bias in %.
Fixes #16354.
1 parent f8a9211 commit c88feff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/doc/guide.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1894,7 +1894,8 @@ Also, you may wonder why we are using `%` on the result of `rand::random()`.
18941894
This operator is called 'modulo', and it returns the remainder of a division.
18951895
By taking the modulo of the result of `rand::random()`, we're limiting the
18961896
values to be between 0 and 99. Then, we add one to the result, making it from 1
1897-
to 100.
1897+
to 100. Using modulo can give you a very, very small bias in the result, but
1898+
for this example, it is not important.
18981899

18991900
Let's try to compile this using `cargo build`:
19001901

0 commit comments

Comments
 (0)