- attempt to fix additional oos issues

This commit is contained in:
Mark Vejvoda
2013-09-30 17:38:26 +00:00
parent dc944b2a79
commit de8b083329
17 changed files with 330 additions and 345 deletions

View File

@@ -519,7 +519,7 @@ void Properties::setBool(const string &key, bool value){
}
void Properties::setFloat(const string &key, float value){
setString(key, floatToStr(value,16));
setString(key, floatToStr(value,10));
}
void Properties::setString(const string &key, const string &value){

View File

@@ -81,7 +81,7 @@ int RandomGen::randRange(int min, int max,string lastCaller) {
int diff= max-min;
double numerator = static_cast<double>(diff + 1) * static_cast<double>(RandomGen::rand(lastCaller));
int res= min + static_cast<int>(truncateDecimal<double>(numerator / static_cast<double>(m),16));
int res= min + static_cast<int>(truncateDecimal<double>(numerator / static_cast<double>(m),10));
if(res < min || res > max) {
char szBuf[8096]="";
snprintf(szBuf,8096,"In [%s::%s Line: %d] res < min || res > max, min = %d, max = %d, res = %d",__FILE__,__FUNCTION__,__LINE__,min,max,res);
@@ -102,7 +102,7 @@ double RandomGen::randRange(double min, double max,string lastCaller) {
double rand01 = static_cast<double>(RandomGen::rand(lastCaller)) / (m-1);
double res= min + (max - min) * rand01;
res = truncateDecimal<double>(res,16);
res = truncateDecimal<double>(res,10);
if(res < min || res > max) {
char szBuf[8096]="";