Random number generator now works with size_t

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@869 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Jan Möbius
2013-07-24 09:38:26 +00:00
parent 420b5e5928
commit d3cd7bfe06
3 changed files with 11 additions and 8 deletions

View File

@@ -63,12 +63,12 @@ namespace OpenMesh {
//== IMPLEMENTATION ===========================================================
RandomNumberGenerator::RandomNumberGenerator(const double _resolution) :
RandomNumberGenerator::RandomNumberGenerator(const size_t _resolution) :
resolution_(_resolution),
iterations_(1),
maxNum_(RAND_MAX + 1.0)
{
double tmp = resolution_;
double tmp = double(resolution_);
while (tmp > (double(RAND_MAX) + 1.0) ) {
iterations_++;
tmp /= (double(RAND_MAX) + 1.0);
@@ -91,7 +91,7 @@ double RandomNumberGenerator::getRand() const {
return randNum / maxNum_;
}
double RandomNumberGenerator::resolution() const {
size_t RandomNumberGenerator::resolution() const {
return maxNum_;
}