Signed word lengths and indexes
BCS
none at anon.com
Thu Jun 17 18:15:48 PDT 2010
Hello Don,
> BCS wrote:
>
>> Hello Don,
>>
>>> Surprise! c == -1.
>>>
>> No kidding!
>>
>>> Because 1 is an int, b gets promoted to int before the shift
>>> happens.
>>>
>> Why would it ever need to be promoted? Unless all (most?) CPUs have
>> only size_t shifts, all three shifts should never promote the LHS.
>>
> It shouldn't NEED to. But C defined that >> and << operate that way.
>
At leat for the >>> can we break that? C doesn't even *have* a >>> operator.
--
... <IXOYE><
More information about the Digitalmars-d
mailing list