Commit feb6aab
distributions: support a zero max value in Zipf.
There is no documentation that says zero isn't okay, and the closed interval
[0, k] described by the documentation is perfectly well-defined even when k is
zero. As far as I can tell, there is no reason *not* to support zero: a random
variable that always returns the same value is still a random variable.
absl::Uniform will happily generate on the interval [0, 1) for the same
reason.
PiperOrigin-RevId: 694649518
Change-Id: Ib940406f762a30e27c19c846c45bd908ae8411c31 parent 8924509 commit feb6aab
2 files changed
+9
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
473 | 480 | | |
474 | 481 | | |
475 | 482 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| |||
0 commit comments