Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re[2]: [AVR-Chat] logical shift operation

2009-06-27 by Антощенков Роман Викторович

Hello!

Problem solved. It is my fault.

>> i1 = 1024;
>> i2 = i1 >> 2;
>> c1 = (unsigned char)i1>>2;
>>
>> Why c1 = 0? Must be c1 = 256!

 i1 = 1023; !
 i2 = i1 >> 2;
 c1 = (unsigned char)i1>>2;
 c1 = 255 !
-- 
Best regards,
Roman Antoshchenkov
mailto:djantoxa@rambler.ru

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.