changeset 1180 | 389416f8a995 |
parent 1134 | f70f688d9ef9 |
child 1185 | c8d0179a32a2 |
30:9d55bbb37dcb | 34:967116e4e2ed |
---|---|
340 ::mask(max); |
340 ::mask(max); |
341 Word num; |
341 Word num; |
342 do { |
342 do { |
343 num = rnd() & mask; |
343 num = rnd() & mask; |
344 } while (num > max); |
344 } while (num > max); |
345 return num; |
345 return static_cast<Result>(num); |
346 } |
346 } |
347 }; |
347 }; |
348 |
348 |
349 template <typename Result, int exp> |
349 template <typename Result, int exp> |
350 struct ShiftMultiplier { |
350 struct ShiftMultiplier { |