diff options
Diffstat (limited to 'base/rand_util.h')
-rw-r--r-- | base/rand_util.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/base/rand_util.h b/base/rand_util.h index 4e902da..d10cc8b 100644 --- a/base/rand_util.h +++ b/base/rand_util.h @@ -29,6 +29,10 @@ BASE_API uint64 RandGenerator(uint64 max); // Returns a random double in range [0, 1). Thread-safe. BASE_API double RandDouble(); +// Given input |bits|, convert with maximum precision to a double in +// the range [0, 1). Thread-safe. +BASE_API double BitsToOpenEndedUnitInterval(uint64 bits); + // Returns a random string of the specified length. BASE_API std::string RandBytesAsString(size_t length); |