45 return ceil(x * (1 << fractionBits)) / (1 << fractionBits);
49 const double x2 = x * (1 << fractionBits);
50 const double rounded = x2 < 0 ? ceil(x2 - 0.5) : floor(x2 + 0.5);
51 return rounded / (1 << fractionBits);
55 const double p = pow(10, precision);
56 const double x2 = x * p;
57 return (x2 < 0 ? ceil(x2 - 0.5) : floor(x2 + 0.5)) / p;
62 if (frac < 0 || frac == 1.) {
65 const int base = (int)frac;
66 const int resolution = 1000;
67 const int intFrac = (int)floor((frac - base) * resolution + 0.5);
69 if (((loaded % resolution) * intFrac) % resolution < intFrac) {
int getScalingQuota(double frac, int loaded)
Returns the number of instances of the current object that shall be emitted given the number of loade...
double truncate(double x, int fractionBits)
discrds mantissa bits beyond the given number
int gPrecision
the precision for floating point outputs
double gWeightsRandomFactor
double roundBits(double x, int fractionBits)
round to the given number of mantissa bits beyond the given number
double gWeightsWalkOppositeFactor
std::string gLanguage
the language for GUI elements and messages
bool gIgnoreUnknownVClass
double roundDecimal(double x, int precision)
round to the given number of decimal digits
bool gDebugFlag1
global utility flags for debugging
int GUIDesignHeight
the default size for GUI elements