project files added

This commit is contained in:
mhalfmann
2021-06-15 16:00:08 +02:00
parent e156e2f053
commit db46afa351
13928 changed files with 1569902 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(Math, "imul", { value: require("./shim"),
configurable: true,
enumerable: false,
writable: true });
}
+5
View File
@@ -0,0 +1,5 @@
"use strict";
module.exports = require("./is-implemented")()
? Math.imul
: require("./shim");
+7
View File
@@ -0,0 +1,7 @@
"use strict";
module.exports = function () {
var imul = Math.imul;
if (typeof imul !== "function") return false;
return imul(-1, 8) === -8;
};
+17
View File
@@ -0,0 +1,17 @@
/* eslint no-bitwise: "off" */
// Thanks: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
// /Global_Objects/Math/imul
"use strict";
module.exports = function (val1, val2) {
var xh = (val1 >>> 16) & 0xffff
, xl = val1 & 0xffff
, yh = (val2 >>> 16) & 0xffff
, yl = val2 & 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;
};