Actually, nearly every modern compiler will optimize divisions by powers of two *into* bit shifts, so >> isn't faster than / at all... unless your compiler/optimizer is retarded.
>From: "Paul Franz" <[EMAIL PROTECTED]> >Reply-To: "JDJList" <[EMAIL PROTECTED]> >To: "JDJList" <[EMAIL PROTECTED]> >Subject: [jdjlist] Re: Shift Operator: What is it good for? >Date: Thu, 5 Sep 2002 14:40:06 -0400 > >Shift Operator: What is it good for?Dividing by a multiple of 2. This is >faster than using the / operator. > >Paul Franz > ----- Original Message ----- > From: Hansen, Knud > To: JDJList > Sent: Thursday, September 05, 2002 2:19 PM > Subject: [jdjlist] Shift Operator: What is it good for? > > > 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 > > > > > > 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 ----------------------------------------------- Joseph B. Ottinger [EMAIL PROTECTED] http://enigmastation.com IT Consultant _________________________________________________________________ Join the world�s largest e-mail service with MSN Hotmail. http://www.hotmail.com To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm
