Front.
Bitwise operators are very low-level operations and are not commonly used because they are not intuitive. However, its speed is very fast, and reasonable use can achieve very good results. This article will introduce the operator-bitwise
Bitwise operatorsC provides six bitwise operators. These operators may only allow integer operands, namely char, short, Int, and long, regardless of signed or unsigned.& By-bit and| Bitwise OR^ Bitwise OR> Right shift~ Inverse (unary
in C #, you can perform a bitwise logical operation on an integer operand. The meaning of the bitwise logical operation is that each bit of the operand is taken sequentially, and the logical operation of each bit is the result of each bit of the
Bitwise operations are one of the basic operations in C/C ++. Even so, it is a strange operation for most programmers-most programmers seldom use bitwise operations. This article first briefly introduces the basic bitwise operators and their usage
Summary
Bitwise operations are one of the basic operations in C/C ++. Even so, it is a strange operation for most programmers-most programmers seldom use bitwise operations. This article first briefly introduces the basic bitwise operators and
1. cBitwise operators in languages
Because the C language is designed to replace the assembly language, it must support the computing power of the assembly language, so the C language supports all bitwise operators ). Bit operations are used to test,
Bitwise operations in Java
Java bit operator
Bitwise operators are used to operate binary bits. Java provides bitwise operators as shown below:
Bitwise operator (>>,>>,&, |, ^ ,~ ), In the bitwise operator, ~ The others are binary operators. The
C # basic usage of bitwise operators,
Bitwise operators include: | bitwise OR, & bitwise AND, ^ bitwise xor or xor ,~ NOT, Right Shift, and so on. This article describes the application of the bitwise operator in C. It mainly includes:
○
Bitwise operators include: | bitwise OR or, & bitwise AND and, ^ bitwise XOR or XOR ,~ Not, right shift, and so on. This article describes the application of the bitwise operator in C. It mainly includes:
○ Hexadecimal conversion※Convert
InC ProgrammingIn, the bit of data is the smallest unit of data that can be operated. In theory, you can use the bitwise operation to complete all the operations and operations. AverageBit operationIt is used to control hardware or perform data
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.