lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Oct 23, 2014 at 3:17 PM, William Ahern
<william@25thandclement.com> wrote:
>> That is, 2^7 +1 is -128 for a "signed char" (or whatever) or it's 129 for
>> an unsigned char, even though the rvalue's bits are the same...?
>
> I think you may have meant -127. But the bits are not necessarily the same.
> That's only the case in two's complement representation. You have to be
> careful about differentiating value and representation.[1]

No, he meant -128, the range of a signed byte in two's complement is
-128 to +127.

/s/ Adam