Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2814)

Unified Diff: base/rand_util.h

Issue 6883102: Add one-time randomization support for FieldTrial, and the ability to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Responding to review comments. Fix initialization in browser_main. Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/rand_util.h
diff --git a/base/rand_util.h b/base/rand_util.h
index a4ea479e334edad7d181e5b4e27da46744deed11..a4ecf57efc89995d9afa42c7e82b5a96fbc0cc69 100644
--- a/base/rand_util.h
+++ b/base/rand_util.h
@@ -27,6 +27,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 rand-like
+// double, i.e. in the range [0, 1). Thread-safe.
+BASE_API double BitsToOpenEndedUnitInterval(uint64 bits);
+
} // namespace base
#endif // BASE_RAND_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698