Skip to content

Instantly share code, notes, and snippets.

@msly
Last active June 20, 2016 03:27
Show Gist options
  • Select an option

  • Save msly/c69063162d17c6872546b6962a99b534 to your computer and use it in GitHub Desktop.

Select an option

Save msly/c69063162d17c6872546b6962a99b534 to your computer and use it in GitHub Desktop.
生成类似java的随机数
// 0.8822016520425677
std::string _create_random()
{
static default_random_engine random;
uniform_real_distribution<double> dis(0.0, 1.0);
uniform_int_distribution<int> dis2(100000000, 999999999);
return fmt::format("{}{}", dis(random), dis2(random));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment