Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Unified Diff: tracing/tracing/base/math.html

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tracing/tracing/base/iteration_helpers.html ('k') | tracing/tracing/base/range.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/base/math.html
diff --git a/tracing/tracing/base/math.html b/tracing/tracing/base/math.html
index 59b5d3117b9987785db7005d8e2d1311cacdf85d..89d7ea472609d6338e11a56b6938aa754ca0fdad 100644
--- a/tracing/tracing/base/math.html
+++ b/tracing/tracing/base/math.html
@@ -31,6 +31,13 @@ found in the LICENSE file.
'use strict';
tr.exportTo('tr.b', function() {
+ /* Returns true when x and y are within delta of each other. */
+ function approximately(x, y, delta) {
+ if (delta === undefined)
+ delta = 1e-9;
+ return Math.abs(x - y) < delta;
+ }
+
function clamp(x, lo, hi) {
return Math.min(Math.max(x, lo), hi);
}
@@ -156,6 +163,7 @@ tr.exportTo('tr.b', function() {
};
return {
+ approximately: approximately,
clamp: clamp,
lerp: lerp,
normalize: normalize,
« no previous file with comments | « tracing/tracing/base/iteration_helpers.html ('k') | tracing/tracing/base/range.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698