Unsigned Right Shift Operator (>>>)

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

I am trying to convert a Java APP to C# and it appears C# does not have a
Thanks.
 
Cast the variable to unsigned.

e.g. if it is a "long":

unsigned long result = ((unsigned long)myVariable) >> myShift;

BTW I have got so used to the new C++ style of casting, where the variable
goes inside brackets and you therefore know unequivocally the scope of the
cast, that I can't imagine why C# uses the old C-style casts.

S.
 
PS... perhaps you should be using an unsigned type in the first place?

S.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top