News for hackers. Stuff that matters.
Re:The Curious Case of JavaScript’s `sort` by js2 on Wednesday April 13, 2016 @11:14AM (#11488844)
The suggestion:

    function compareNumbers(a, b) {
        return a - b;
    }
Can this not suffer from overflow/underflow?
Re:The Curious Case of JavaScript’s `sort` by gpvos on Wednesday April 13, 2016 @11:21AM (#11488927)
Javascript numbers are reals, not integers. If they become too large (positively or negatively), they become +Infinity or -Infinity.
Re:The Curious Case of JavaScript’s `sort` by hajile on Wednesday April 13, 2016 @11:24AM (#11488951)
All numbers in JS are floats. Overflow and underflow are represented as positive and negative infinity while the check itself looks for 0, greater than zero, less than zero. Both infinities qualify as greater or less than zero (respectively), so I don't believe this problem exists.