Index: third_party/polymer/v1_0/components/iron-range-behavior/iron-range-behavior.html |
diff --git a/third_party/polymer/v1_0/components/iron-range-behavior/iron-range-behavior.html b/third_party/polymer/v1_0/components/iron-range-behavior/iron-range-behavior.html |
index d89843d3613707bdd60e224e7f639c10c05417f4..4306e6924e51134aca979cc5ecd7bdd04e956b1e 100644 |
--- a/third_party/polymer/v1_0/components/iron-range-behavior/iron-range-behavior.html |
+++ b/third_party/polymer/v1_0/components/iron-range-behavior/iron-range-behavior.html |
@@ -83,6 +83,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
}, |
_calcStep: function(value) { |
+ /** |
+ * if we calculate the step using |
+ * `Math.round(value / step) * step` we may hit a precision point issue |
+ * eg. 0.1 * 0.2 = 0.020000000000000004 |
+ * http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html |
+ * |
+ * as a work around we can divide by the reciprocal of `step` |
+ */ |
return this.step ? (Math.round(value / this.step) / (1 / this.step)) : value; |
}, |