News for hackers. Stuff that matters.
Re:Negative Base by foxhill on Thursday June 28, 2018 @04:34PM (#17420244)
basically every language with IEEE-754[1] compliance..!

[1] - https://en.m.wikipedia.org/wiki/IEEE_754

Re:Negative Base by bzbarsky on Friday June 29, 2018 @01:26AM (#17422593)
I'd think that in all those languages, -0 == +0 tests true, though. In JavaScript even -0 === +0 tests true.

The only way to tell them apart in general is to divide by them. In some languages you might be able to type-pun and examine the bit pattern, or do things like Object.is() or whatnot.

Re:Negative Base by saagarjha on Thursday June 28, 2018 @06:28PM (#17420991)
But only when imposing a total ordering.
Re:Negative Base by foxhill on Thursday June 28, 2018 @06:33PM (#17421011)
that’s not the case, in IEE754 floating point, zero is signed - i.e negative and positive zero are distinct values
Re:Negative Base by saagarjha on Thursday June 28, 2018 @08:46PM (#17421620)
But the standard comparison operators don’t distinguish them.