eugene.litvinov Posted February 5, 2011 Posted February 5, 2011 Have unigine round function? In manual described only ceil and floor.
eugene.litvinov Posted February 8, 2011 Author Posted February 8, 2011 C++ have not round function too... It's XXI century... our space ships sail space of the Universe. Maybe it's time to add it in rank with ceil() and floor()? :)
steve3d Posted February 11, 2011 Posted February 11, 2011 float round(float val) { int mod = val * 10 % 5; if(mod >= 5) val += 1.0f; return floor(val); } is this what you want?
frustum Posted February 12, 2011 Posted February 12, 2011 Fast round function for positive values: int round(float value) { return int(value + 0.5f) } Round function for positive and negative values: int round(float value) { if(value > 0.0f) return int(value + 0.5f); return int(value - 0.5f); }
eugene.litvinov Posted February 12, 2011 Author Posted February 12, 2011 Yes, thanks. I find round function realization. I only was surprised, that Unigine have not round function implementation.
Recommended Posts