Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

esnext.data-view.get-float16.js 662B

12345678910111213141516
  1. 'use strict';
  2. var $ = require('../internals/export');
  3. var uncurryThis = require('../internals/function-uncurry-this');
  4. var unpackIEEE754 = require('../internals/ieee754').unpack;
  5. // eslint-disable-next-line es/no-typed-arrays -- safe
  6. var getUint16 = uncurryThis(DataView.prototype.getUint16);
  7. // `DataView.prototype.getFloat16` method
  8. // https://github.com/tc39/proposal-float16array
  9. $({ target: 'DataView', proto: true }, {
  10. getFloat16: function getFloat16(byteOffset /* , littleEndian */) {
  11. var uint16 = getUint16(this, byteOffset, arguments.length > 1 ? arguments[1] : false);
  12. return unpackIEEE754([uint16 & 0xFF, uint16 >> 8 & 0xFF], 10);
  13. }
  14. });