main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
539 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var $ = require('../internals/export');
|
---|
3 |
|
---|
4 | // `Math.imulh` method
|
---|
5 | // https://gist.github.com/BrendanEich/4294d5c212a6d2254703
|
---|
6 | // TODO: Remove from `core-js@4`
|
---|
7 | $({ target: 'Math', stat: true, forced: true }, {
|
---|
8 | imulh: function imulh(u, v) {
|
---|
9 | var UINT16 = 0xFFFF;
|
---|
10 | var $u = +u;
|
---|
11 | var $v = +v;
|
---|
12 | var u0 = $u & UINT16;
|
---|
13 | var v0 = $v & UINT16;
|
---|
14 | var u1 = $u >> 16;
|
---|
15 | var v1 = $v >> 16;
|
---|
16 | var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);
|
---|
17 | return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16);
|
---|
18 | }
|
---|
19 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.