Skip to content

Commit

Permalink
Udpate readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kontoulis committed Sep 21, 2019
1 parent 4910110 commit 7dfb66c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import "github.com/kontoulis/go-weighted-random-choice"
Instantiate a `WeightedRandomChoice` object by calling `New()`.
`New()` takes optional argument `precision` which is by default `1000` and
is used for the weight calibration in order to generate more precise results.
The `precision` of `1000` will scale weights to a `totalWeight = 1000`, while keeping the weight ratios.
e.g. weights 1, 2, 3 and 4 will become 100, 200, 300 and 400 respectively
```go
wrc := WeightedRandomChoice.New()
```
Expand Down

0 comments on commit 7dfb66c

Please sign in to comment.