commit 3f6eef22e4f50c1fb80557f7e48e85d8224b6281 (tree)
parent df167af0b626479613732389d91e2b7d13f03dc6
Author: ominitay <37453713+ominitay@users.noreply.github.com>
Date: Sun, 24 Oct 2021 21:29:37 +0100
Fix documentation for Random.int
Documentation incorrectly stated that Random.int 'Returns a random int `i`
such that `0 <= i <= maxInt(T)`.' This commit amends this.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/std/rand.zig b/lib/std/rand.zig
@@ -53,7 +53,7 @@ pub const Random = struct {
return values[index];
}
- /// Returns a random int `i` such that `0 <= i <= maxInt(T)`.
+ /// Returns a random int `i` such that `minInt(T) <= i <= maxInt(T)`.
/// `i` is evenly distributed.
pub fn int(r: *Random, comptime T: type) T {
const bits = @typeInfo(T).Int.bits;