Add a coinflip library.
Summary: The naive coinflip algorithm generates a random variable each time the function is called. We can avoid many of these calls to a random number generator by doing some tricky business with math stuff. See https://fb.workplace.com/groups/135724786501553/permalink/5767297086677600/ for some discussion on the topic. The intention behind this code is that we will use it in HHVM. That's why it provides the static methods that allow the caller to supply their own storage space for the counter and their own random number generator. Reviewed By: bmaurer Differential Revision: D30440295 fbshipit-source-id: ee0c3e49da3ec82a9fd6c8854b15ef107755ff39
Showing
Please register or sign in to comment