Re: << and >> operators in c#

Tech-Archive recommends: Speed Up your PC by fixing your registry




Ben wrote:
Hi,

I'm trying to figure out the purpose of these operators.
Now, I know what they do. They shift bits either left or right.
But I don't know why would anybody want to do that. I've never seen
anyone using it in his/her code.
Any ideas?

it is a tragic mistake that an operator that is tailor made for piping
and adding to lists, is reserved instead for such a trivial, seldom
used operation. If you want to shift bits, better to have a new literal
operator:
bunchOfBits shiftleft 2 ;

-Steve

.



Relevant Pages

  • Re: change value and concatenate
    ... The purpose of the for loop is to shift down all the fields so that, ... shifted down by two sonce $4 and $5 have been unified. ...
    (comp.lang.awk)
  • Re: How do I disable - confirm file deletion
    ... I hadn't heard of using the shift for that ... purpose (use it for selecting and for other things, ... Badger Phone ...
    (microsoft.public.windowsxp.general)
  • Re: html and un-intentional double spacing
    ... or use plain text if its a problem. ... I know about shift enter but defeats the purpose in regular email clients which I believe is the majority of recipients. ...
    (microsoft.public.outlook)
  • Re: Answers and Results - RJGK 67: "aap se tum, tum se tuu hone lagii"
    ... This may not be relevant to the current discussion on pronoun shifts ... Grammatical Shift For The Rhetorical Purposes: ... Arabic has tense shift as well to serve the same purpose. ...
    (rec.music.indian.misc)
  • Re: << and >> operators in c#
    ... Maybe you would like to expand on the 'piping and 'adding' bits. ... what makes you think that bit-shifting is seldom used? ... They shift bits either left or right. ...
    (microsoft.public.dotnet.languages.csharp)