Skip to content

Commit

Permalink
Fix Math.signbit semantics
Browse files Browse the repository at this point in the history
According [spec draft](https://tc39.es/proposal-Math.signbit/Math.signbit.html#spec), Math.signbit returns `true` only for negative values and `Math.signbit(NaN)` should return `true`
  • Loading branch information
chicoxyzzy committed Nov 3, 2019
1 parent 306ba2c commit 4d002ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core-js/modules/esnext.math.signbit.js
Expand Up @@ -4,6 +4,6 @@ var $ = require('../internals/export');
// https://github.com/tc39/proposal-Math.signbit
$({ target: 'Math', stat: true }, {
signbit: function signbit(x) {
return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0;
return (x = +x) == x && x == 0 ? 1 / x == Infinity : x < 0;
}
});

0 comments on commit 4d002ef

Please sign in to comment.