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
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,
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
Bitwise AND Operator:&
Grammar
Expression
&
expression
NoteAn expression can be another "and" expression, or (follow the type restrictions described below) equality expressions, relational expressions, addition expressions,
Comparison between bitwise operation and multiplication and division operation.
Many bitwise operations exist in Java JDK. The purpose is to make the code run faster. Let's conduct an experiment to see how much computing time can be saved.
In the
Bitwise Operations implement addition, subtraction, multiplication, division, and four arithmetic operations1. Description
How do I use bitwise operations to perform the addition, subtraction, multiplication, and division of integers?
2. SolutionYou
Bitwise operatorsBitwise operators are operations that align bits from low to high.
symbols
function
Example
Personal Understanding
&
Bitwise-AND
$m & $n
Full 1 is 1, otherwise 0
[Java Basics] 14. bitwise operations-bitwise AND (&) operations-(fast modulo algorithm) and java Basics 14 Operations
The redis dictionary structure is learned. The hash Value & sizemask operation is used when the hash is used to find the index
I. Six operators in C language:
& Bitwise AND
| By bit or
^ Bitwise OR
~ Invert
> Right shift
1. bitwise AND OPERATION
Bitwise AND operator "&" are binary operators.
Its function is the binary phase corresponding to the two numbers involved in the
12-bit arithmeticThe C language is designed for the description system, so it should have some functions that are done by assembly language. C language has the features of high-level language and low-level language. Therefore, it has a wide range of
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.