Re: Bitwise shift operator on 8-byte integers

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

 



hi Eljay,

I understand the solution given by u and its workign
is also fine . but could not understand why this is
not working

thanks

ankit
 --- Krzysztof.Wisniowski@xxxxxxxxxxx wrote: 
> Hallo *, 
> Here's the problem:
> 
> unsigned int ui = 4294967295; //2^16-1
> unsigned long long uL; //8-byte variable
> 
> uL = ui << 16;
> 
> The outcome of this operation is 4294901760, meaning
> that 16 bits were
> shifted to "nowhere".
> Seems to me that bitwise shift operator does not
> work over 32-bit limit.
> Is there a simple work around this problem?
> 
> BR,
> -- 
> Krzysztof Wisniowski   | Siemens Sp. z o.o.
> ICM SDC NMR 3          | Software Design Center
> Phone: +48 71 799 2403 | 54A Strzegomska Str.
> Fax: +48 71 799 2320   | 53-611 Wroclaw POLAND 
> 
>  

________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux