19 lines
628 B
C++
19 lines
628 B
C++
/*******************************************************************************
|
|
Copyright © 2017 Philips Lighting Holding B.V.
|
|
All Rights Reserved.
|
|
********************************************************************************/
|
|
|
|
#include "Random.h"
|
|
|
|
#include <chrono>
|
|
#include <random>
|
|
|
|
using namespace std;
|
|
|
|
static auto seed = chrono::system_clock::now().time_since_epoch().count();
|
|
static default_random_engine generator(static_cast<unsigned int>(seed));
|
|
static uniform_real_distribution<double> distribution (0.0,1.0);
|
|
|
|
double Random(double min, double max) {
|
|
return distribution(generator) * (max - min) + min;
|
|
};
|