[pfemidi@pfemidi tmp]$ cat foobar.cpp
#include <iostream>
#include <random>
#include <chrono>
int main() {
const double from = 1.0;
const double to = 1.19;
std::default_random_engine engine(
std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()));
std::uniform_real_distribution<> distr(from, to);
auto gen_number = [&engine, &distr] () { return distr(engine); };
std::cout << gen_number() << std::endl;
}
[pfemidi@pfemidi tmp]$ g++ foobar.cpp -o foobar
pfemidi@pfemidi tmp]$ ./foobar
1.07033
[pfemidi@pfemidi tmp]$ ./foobar
1.12032
[pfemidi@pfemidi tmp]$ ./foobar
1.14531
[pfemidi@pfemidi tmp]$ ./foobar
1.1703
[pfemidi@pfemidi tmp]$ ./foobar
1.00529
[pfemidi@pfemidi tmp]$ ./foobar
1.03029
[pfemidi@pfemidi tmp]$ ./foobar
1.00107
[pfemidi@pfemidi tmp]$ ./foobar
1.02606
[pfemidi@pfemidi tmp]$