ToInt16.js 255 B

12345678910
  1. 'use strict';
  2. var ToUint16 = require('./ToUint16');
  3. // https://262.ecma-international.org/6.0/#sec-toint16
  4. module.exports = function ToInt16(argument) {
  5. var int16bit = ToUint16(argument);
  6. return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit;
  7. };