Negative binary. x_x;;;
Alright, so I understand binary numbers and how they work and such. Now, I was just reading up something randomly and came across negative binary numbers.
I understand how it works, and why it's like that.
You basically take the binary number of the positive, and then inverse all the numbers, and add 1 to that number.
What I don't understand is, how it's read... ._.;
For example, let's say we have number 5.
Binary of that is...101.
A negative of that would be = 010+1= 011. I understand usually that it's written in 8 bits. And that's another question. ._.;
Why 8?
So the final of that would be.... 1111 1011. The parts bolded are my questions..
I believe in a signed value the high bit is set when it is negative and 0 when not. I'm not going to claim I am 100% on that but am fairly certain...
Also keep in mind the high bit is n places depending on int8, int16, int32 etc not always bit 8 which would only be true for a int8 (signed byte) in the range of -127 to +127
Anyway what I am getting at for int8:
11111111 = -127
10000001 = -1
10000000 = -0 (0)
00000000 = 0
00000001 = 1
01111111 = 127
Hope that made sense :/
Someone feel free to correct me if I am wrong!