Hello i'm just starting out with csharp.
and am trying to figure out why an sbyte can take any value from '-128'
to 128.
i've drawn a BIT box with eight bytes, and I'm assuming the eighth bit
is used to SIGN the number, which leaves seven bits.
when all 7 bits are on you get : 127
so i was assuming the most you can get negative would be 127, and the
eighth bit would be used to sign the fact that the number was
negative...
where does the extra one to make -128 come from?
If i've totally misunderstood the handling of this variable in the
computers memory.. please advise.
thanks,
Gary.
and am trying to figure out why an sbyte can take any value from '-128'
to 128.
i've drawn a BIT box with eight bytes, and I'm assuming the eighth bit
is used to SIGN the number, which leaves seven bits.
when all 7 bits are on you get : 127
so i was assuming the most you can get negative would be 127, and the
eighth bit would be used to sign the fact that the number was
negative...
where does the extra one to make -128 come from?
If i've totally misunderstood the handling of this variable in the
computers memory.. please advise.
thanks,
Gary.
Comment