Index: cc/base/math_util.h |
diff --git a/cc/base/math_util.h b/cc/base/math_util.h |
index a83ab4fdce34be03b56fd23ffe978262abbe69fb..ad7f508a38993b01ec2aa3cd5f6b8b89ccf56634 100644 |
--- a/cc/base/math_util.h |
+++ b/cc/base/math_util.h |
@@ -96,6 +96,10 @@ class CC_EXPORT MathUtil { |
static double Round(double d) { |
return (d > 0.0) ? std::floor(d + 0.5) : std::ceil(d - 0.5); |
} |
+ // Round the given float value to fixed precision. This makes amlost euqal |
+ // floats (differ by some threshold magnitude of floating point epsilon) to |
+ // be considered as same. |
+ static float RoundToFixedPrecision(float value); |
// Returns true if rounded up value does not overflow, false otherwise. |
template <typename T> |