es.math.f16round.js 455 B

123456789101112131415
  1. 'use strict';
  2. var $ = require('../internals/export');
  3. var floatRound = require('../internals/math-float-round');
  4. var FLOAT16_EPSILON = 0.0009765625;
  5. var FLOAT16_MAX_VALUE = 65504;
  6. var FLOAT16_MIN_VALUE = 6.103515625e-05;
  7. // `Math.f16round` method
  8. // https://tc39.es/ecma262/#sec-math.f16round
  9. $({ target: 'Math', stat: true }, {
  10. f16round: function f16round(x) {
  11. return floatRound(x, FLOAT16_EPSILON, FLOAT16_MAX_VALUE, FLOAT16_MIN_VALUE);
  12. }
  13. });