Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
Bitwise operators are used in low-level programming. It performs operations at the individual bit level. It is also used in encoding and decoding data for custom protocol communication.
List of Bitwise operators:
First is Bitwise AND Operator.
The second is Bitwise OR Operator.
The third is Bitwise NOT Operator.
Fourth is Bitwise XOR Operator.
And last is Bitwise Shift Left and Shift Right Operator.
1 Bitwise AND Operator:- This operator returns 1 only when both the operand are 1 else it returns 0. Its symbol is “&”.
Example.
In the above example, the binary of 40 is “00101000” and the binary of 28 is “00011100”. So when we perform Bitwise AND operations then the result will be “00001000” which is “8” in decimal.
2 Bitwise OR Operator:- This operator returns 1 when either one operand is 1 else it returns 0. Its symbol is “|”.
Example
Similarly, like the Bitwise And operator example, when we perform the Bitwise OR operation on “00101000”, “00011100” the result will be “00111100” which is 60 in decimal.
3 Bitwise NOT Operator:- This operator inverts the bit. Its symbol is “~”.
When we perform Bitwise Not operation on 40 then it will be -40( (-40+1) ).
4 Bitwise XOR Operator:- It returns 1 only if one of the operands is 1 else 0. Its symbol is “^”.
5 Bitwise Shift Left and Shift Right Operator:- The Bitwise shift Left operators shifts the bit to the left side by a specific number of bits. Its symbol is “<<“. whereas The Bitwise shift Right operators shift the bit to the Right side by a specific number of bits. Its symbol is “>>”.
Thanks for reading this blog.
You can also check other blogs from here. If you have any issues, queries, or suggestions then you can leave your issues/queries/suggestions in the comment section.
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
It was a successful collaboration. The Mobikul team provided the client everything they needed in a timely and high-quality manner. They were very professional, reliable, and accessible during the entire process. The client also saw no room for any improvements in the vendor's performance.
Vincenzo Carrano
Administrator, Segshop
USA
India
Global
Name
Email
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.