© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
9 replies
Raki

❔ How bit wise shift operation work

I started learning bit wise operation.
So i have a uint = 0101 bit which is int 5. Which is in loop to see how it works

Consider n =0101
1st iteration
var test = (n >> 0) // The value is 101

2nd iteration
var test = (n >> 1) // The value of test is 50

How this Happens what i assumed is 0101 on 2nd iteration will become as 1010 so it will be 9. But how it becomes 50.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Caesar shift
C#CC# / help
4y ago
❔ unsafe pointer operation
C#CC# / help
3y ago
what does assembly mean c#-wise ?
C#CC# / help
2y ago