This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Indoor/math/random/Unique.h
2017-11-15 17:46:06 +01:00

27 lines
470 B
C++

#ifndef K_MATH_RND_UNIQUE_H
#define K_MATH_RND_UNIQUE_H
namespace Random {
/**
* provides some common functions
* for handling uniquely distributed random numbers
*/
class Unique {
public:
/** get uniquely distributed random number between min and max */
static double getBetween(double min, double max) {
double rnd = (double) rand() / (double) RAND_MAX;
rnd *= (max-min);
rnd += min;
return rnd;
}
};
}
#endif // K_MATH_RND_UNIQUE_H