37 return ceil(x * (1 << fractionBits)) / (1 << fractionBits);
41 const double x2 = x * (1 << fractionBits);
42 const double rounded = x2 < 0 ? ceil(x2 - 0.5) : floor(x2 + 0.5);
43 return rounded / (1 << fractionBits);
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
bool gDebugFlag1
global utility flags for debugging