All the tech guys are already familiar, but this intro will give everyone on the hive community a better view of me.
Bitwise Operator
Bitwise operator is an operator used to perform bitwise operations on bit patterns or binary numerals to manipulate individual bits. Below is a list of such operators listed by their order of precedence:
- OR (|)
- AND (&)
- XOR (^)
- NOT (~)
- >> (Right-Shift) and << (Left-Shift)
and their order of precedence is given below:
- ~
- << and >>
- &
- ^
- |
Leaving every other alone, let's dive into rightshift.
RightShift
Right shift operator shifts all bits towards right by certain number of specified bits.
Features of RightShift
- It is denoted by >>
- Bit Pattern of the data can be shifted by specified number of Positions to Right
- When Data is Shifted Right , leading zero’s are filled with zero.
- Right shift Operator is Binary Operator [Bi – two] which means it require two arguments.
The operation and working of right shift can be better understood from the pic below:
Simple Programming
Below is a simple code to understand the working of rightshift (code in C)
#include<stdio.h>
int main()
{
int a = 60;
printf("\nNumber is Shifted By 1 Bit : %d",a >> 1);
printf("\nNumber is Shifted By 2 Bits : %d",a >> 2);
printf("\nNumber is Shifted By 3 Bits : %d",a >> 3);
return(0);
}
and its output is shown below :
Number is Shifted By 1 Bit : 30
Number is Shifted By 2 Bits : 15
Number is Shifted By 3 Bits : 7
Applications of rightshift
Right shift is generally used in lower-level programming such as device drivers, low-level graphics, communications protocol packet assembly, and decoding. It is used to divide any number by any power of two.
For example x = x / 2; is x>>1
Still confused
For all those who still have no idea about what it is all about, are free to understand me from the pic below:
although i dint understood your post, the last pic was a good go -->>
wow! just wow! what did I just read!!
just an intro in my own style
Welcome rightshift!
Ecency is mobile and desktop application that improves your experience on Hive.
Download Android: https://android.ecency.com, iOS: https://ios.ecency.com, desktop: https://desktop.ecency.com apps that helps you to gain new followers and stay connected with your friends, unique features - notifications, bookmarks, favorites, drafts, and more.
We reward our users with encouragement upvotes as well as Points to promote and boost your content.
Learn more: https://ecency.com
Join our discord: https://discord.me/ecency