diff --git a/lib/std/rand.zig b/lib/std/rand.zig index 5b4655bc5d333f8c6a0fa301d60b08d7e4a30a63..299d87d39c3e573acdec654014ae694c5f5789e2 100644 --- a/lib/std/rand.zig +++ b/lib/std/rand.zig @@ -1123,3 +1123,7 @@ fn testRangeBias(r: *Random, start: i8, end: i8, biased: bool) void { } } } + +test "" { + std.meta.refAllDecls(@This()); +} diff --git a/lib/std/rand/ziggurat.zig b/lib/std/rand/ziggurat.zig index c29d3eeb2b38a7dc4dee12474aedf3570c902f23..06728f170cff8b24b2b853be23500dc77c46e7c0 100644 --- a/lib/std/rand/ziggurat.zig +++ b/lib/std/rand/ziggurat.zig @@ -16,8 +16,8 @@ pub fn next_f64(random: *Random, comptime tables: ZigTable) f64 { while (true) { // We manually construct a float from parts as we can avoid an extra random lookup here by // using the unused exponent for the lookup table entry. - const bits = random.scalar(u64); - const i = @as(usize, bits & 0xff); + const bits = random.int(u64); + const i = @as(usize, @truncate(u8, bits)); const u = blk: { if (tables.is_symmetric) {