1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

rand: reorganize: phase 2

This commit is contained in:
Hungry Blue Dev
2020-06-09 18:36:07 +05:30
committed by GitHub
parent 67fcce2d46
commit e649cf84e3
28 changed files with 603 additions and 408 deletions

View File

@@ -8,5 +8,5 @@ const (
)
// random returns a random time struct in *the past*.
pub fn random() time.Time {
return time.unix(rand.next(int(start_time_unix)))
return time.unix(int(rand.u64n(start_time_unix)))
}

View File

@@ -3,7 +3,7 @@ import rand
fn test_random() {
// guarantee CI test stability, by seeding the random number generator with a known seed
rand.seed(0)
rand.seed([u32(0), 0])
t1 := tmisc.random()
t2 := tmisc.random()
t3 := tmisc.random()