multi: Fix typos [skip ci]

This commit is contained in:
Dimitris Apostolou committed 2022-01-24 12:19:02 +02:00
1 parent f50950640f
commit 530a2059e5
139 files changed
+254 -254

No files matched your search

+2 -2
View File
@@ -11,7 +11,7 @@ import (
var ErrNoPositive = errors.New("no positive weights left")
// weightedChoice draws a random index from the slice of weights, with a
// probability propotional to the weight at the given index.
// probability proportional to the weight at the given index.
func weightedChoice(w []float64) (int, error) {
// Calculate the sum of weights.
var sum float64
@@ -25,7 +25,7 @@ func weightedChoice(w []float64) (int, error) {
// Pick a random number in the range [0.0, 1.0) and multiply it with
// the sum of weights. Then we'll iterate the weights until the number
// goes below 0. This means that each index is picked with a probablity
// goes below 0. This means that each index is picked with a probability
// equal to their normalized score.
//
// Example: