Skip to content

Commit

Permalink
Make comment about small bias in %.
Browse files Browse the repository at this point in the history
Fixes #16354.
  • Loading branch information
steveklabnik committed Aug 18, 2014
1 parent f8a9211 commit c88feff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/doc/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:

Expand Down

5 comments on commit c88feff

@bors
Copy link
Contributor

@bors bors commented on c88feff Aug 19, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from pcwalton
at steveklabnik@c88feff

@bors
Copy link
Contributor

@bors bors commented on c88feff Aug 19, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging steveklabnik/rust/random_remarks = c88feff into auto

@bors
Copy link
Contributor

@bors bors commented on c88feff Aug 19, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

steveklabnik/rust/random_remarks = c88feff merged ok, testing candidate = ef0d49d

@bors
Copy link
Contributor

@bors bors commented on c88feff Aug 19, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = ef0d49d

Please sign in to comment.