main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
541 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | var $TypeError = require('es-errors/type');
|
---|
| 4 |
|
---|
| 5 | var ToInt32 = require('../ToInt32');
|
---|
| 6 | var ToUint32 = require('../ToUint32');
|
---|
| 7 |
|
---|
| 8 | // https://262.ecma-international.org/11.0/#sec-numeric-types-number-unsignedRightShift
|
---|
| 9 |
|
---|
| 10 | module.exports = function NumberUnsignedRightShift(x, y) {
|
---|
| 11 | if (typeof x !== 'number' || typeof y !== 'number') {
|
---|
| 12 | throw new $TypeError('Assertion failed: `x` and `y` arguments must be Numbers');
|
---|
| 13 | }
|
---|
| 14 |
|
---|
| 15 | var lnum = ToInt32(x);
|
---|
| 16 | var rnum = ToUint32(y);
|
---|
| 17 |
|
---|
| 18 | var shiftCount = rnum & 0x1F;
|
---|
| 19 |
|
---|
| 20 | return lnum >>> shiftCount;
|
---|
| 21 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.