13 return std::max(1.0f, std::round(value / unit) * unit);
14 else if (value < 0.0f)
15 return std::min(-1.0f, std::round(value / unit) * unit);
20 default:
return std::round(value / unit) * unit;
float round(float value, float unit, rounding_method method)
Round a floating point value to a specific unit and using a specific rounding method.