#39 #40 git add for last commit

This commit is contained in:
toni
2017-11-15 17:46:06 +01:00
parent c8063bc862
commit 95a5c8f34f
49 changed files with 4661 additions and 0 deletions

26
math/random/Unique.h Normal file
View File

@@ -0,0 +1,26 @@
#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