3 ms·
So does this mean that whenever one is working in 8 bits that it’s taken for granted that the upper bounds represent negative integers? Or does it rather depend
by ughitsaaron 3y ago
So does this mean that whenever one is working in 8 bits that it’s taken for granted that the upper bounds represent negative integers? Or does it rather depend on the context?
- fluoridation 3y agoI'm not sure what you're asking. If you're working with n-bit integers and you interpret the value as unsigned, then all values >= 2^(n-1) (i.e. the upper half of the range) represent negative two's complement values. Or put another way, bit n-1 is on iff the value is negative.
- makeworld 3y agoIt depends on context. Sometimes the bits or bytes represent a signed number, sometimes an unsigned number, sometimes a float, sometimes a string, etc. It's all up to how you choose to interpret it.