parent
f8a9211740
commit
c88feffde4
1 changed files with 2 additions and 1 deletions
|
|
@ -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`:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue