News for hackers. Stuff that matters.
Re:Two's complement – You beauty by kybernetikos on Wednesday January 11, 2017 @02:22AM (#13372367)
Because of this, javascript has a +0 and a -0. They make a fun trivia question because there are very few ways to distinguish them since most of the ways of checking equality (even ===) will report that they are equal.

In fact, I only know two ways to distinguish them: divide something by them, and you get positive infinity for +0 and negative infinity for -0, or you can use Object.is(-0, 0) which will return false.

Re:Two's complement – You beauty by SamBam on Wednesday January 11, 2017 @10:07AM (#13374381)
Weird. I just tried it out. So in Javascript you can have two variables, `a` and `b`, such that `a === b` and `1/a !== 1/b`.
Re:Two's complement – You beauty by AstralStorm on Wednesday January 11, 2017 @08:17AM (#13373678)
No Signum function is a bane in many languages.