Merge branch 'cshenton-patch-1'

closes #5085
master
Andrew Kelley 2020-04-18 14:42:49 -04:00
commit 44ff55091f
2 changed files with 6 additions and 2 deletions

View File

@ -1123,3 +1123,7 @@ fn testRangeBias(r: *Random, start: i8, end: i8, biased: bool) void {
}
}
}
test "" {
std.meta.refAllDecls(@This());
}

View File

@ -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) {