esnext.math.signbit.js 341 B

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