esnext.math.signbit.js 358 B

123456789101112
  1. 'use strict';
  2. var $ = require('../internals/export');
  3. // `Math.signbit` method
  4. // https://github.com/tc39/proposal-Math.signbit
  5. $({ target: 'Math', stat: true, forced: true }, {
  6. signbit: function signbit(x) {
  7. var n = +x;
  8. // eslint-disable-next-line no-self-compare -- NaN check
  9. return n === n && n === 0 ? 1 / n === -Infinity : n < 0;
  10. }
  11. });