Skip to content

Commit 29e7eca

Browse files
authored
rand: add missing i8() utility function (#25819)
1 parent 1108119 commit 29e7eca

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

vlib/rand/rand.v

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,11 @@ pub fn u64_in_range(min u64, max u64) !u64 {
585585
return default_rng.u64_in_range(min, max)
586586
}
587587

588+
// i8 returns a uniformly distributed pseudorandom 8-bit signed (possibly negative) `i8`.
589+
pub fn i8() i8 {
590+
return default_rng.i8()
591+
}
592+
588593
// i16 returns a uniformly distributed pseudorandom 16-bit signed (possibly negative) `i16`.
589594
pub fn i16() i16 {
590595
return default_rng.i16()

0 commit comments

Comments
 (0)