What's -0?

I thought about this a few days ago, but i only just got around to asking. If the first bit of a signed integer is used to indicate the sign (on for -, off for +), then what's -0, i.e., the negative bit is on, but everything else is off?
Depends, using two's complement -0 = 0 = 00000000 00000000 00000000 00000000
using one's complement 0 = ( all zeros ), -0 = ( all ones )

( Usually it's two's complement )
Last edited on
Its more complicated than simply having one bit on or off to determine sign. Numbers are generally stored in a format called "two's complement" as Bazzy says:

http://en.wikipedia.org/wiki/Two's_complement
Oh, I see. I think it would've been cooler if there where a -0, though =P
cooler? maybe.

Less functional? Definitely.
Floating point format has -0 and +0 ;-)
Topic archived. No new replies allowed.