]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/shim.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / node-gyp / node_modules / path-array / node_modules / array-index / node_modules / es6-symbol / node_modules / es5-ext / math / imul / shim.js
diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/shim.js
new file mode 100644 (file)
index 0000000..8fd8a8d
--- /dev/null
@@ -0,0 +1,13 @@
+// Thanks: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
+//         /Global_Objects/Math/imul
+
+'use strict';
+
+module.exports = function (x, y) {
+       var xh  = (x >>> 16) & 0xffff, xl = x & 0xffff
+         , yh  = (y >>> 16) & 0xffff, yl = y & 0xffff;
+
+       // the shift by 0 fixes the sign on the high part
+       // the final |0 converts the unsigned value into a signed value
+       return ((xl * yl) + (((xh * yl + xl * yh) << 16) >>> 0) | 0);
+};