I've used it before to convert between big endian and little endian systems
where the high order and low order bits are reversed.

-----Original Message-----
From: David Rosenstrauch [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 05, 2002 2:30 PM
To: JDJList
Subject: [jdjlist] Re: Shift Operator: What is it good for?


At 02:19 PM 9/5/2002 -0400, you wrote:

>During the discussion about 'Getting digits from an integer' there was a 
>reference to the binary shift operator >>.  In my 15 years of programming 
>I have never once used the shift operator.  I am sure it must be used for 
>something, but I can not think of anything useful.  Anybody out there 
>every use it?  If so, what for?
>
>Thanks
>Knud Hansen


I think it's most commonly used in applying bit-masks (e.g., when you want 
to strip out the "red" value out of RGB color integer values).


DR



To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm

To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm

Reply via email to