Function uintLessThanBiased [src]
Constant-time implementation off uintLessThan.
The results of this function may be biased.
Prototype
pub fn uintLessThanBiased(r: Random, comptime T: type, less_than: T) T
Parameters
r: Random
T: type
less_than: T
Source
pub fn uintLessThanBiased(r: Random, comptime T: type, less_than: T) T {
comptime assert(@typeInfo(T).int.signedness == .unsigned);
assert(0 < less_than);
return limitRangeBiased(T, r.int(T), less_than);
}