Discover bitwise left shift operator, include the articles, news, trends, analysis and practical advice about bitwise left shift operator on alibabacloud.com
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
Javascript bitwise left shift operator (
This article mainly introduces the Javascript bitwise left shift operator (
Bitwise left shift operator (
Left shift expression bit.
Result = expression1
Parameters
Result
Any variable.
Expression1
Language bitwise operators: With, OR, XOR, reverse, move left, and rightA bitwise operation is a binary-based operation. In system software, it is often necessary to deal with bits problems. The C language provides 6 bit manipulation operators.
This article mainly describes the JavaScript bitwise LEFT operator (The bitwise Left operator (<<) shifts the bit of the expression to the left. result = expression1 << expression2 parameter result any variable. Expression1 of any expression.
1. Left shift operatorThe left shift operator 1) Its general format is as follows:Value NUM Specifies the number of bits to shift the value to move.Left-shift rule remembers only one point: Discard the highest bit, 0 the minimum bitIf the number of
The bitwise shift operator is an operation that moves the data as a binary number, moving it to the left or right several bits. The bit shift operators are divided into left and right shifts, both of which are binocular operators. The first
Bitwise left-shift operator (The bit of the left-shift expression.
result = expression1
ParametersResult
Any variable.
Expression1
Any expression.
Expression2
Any expression.
DescriptionThe
var temptemp = The value of the variable temp is
C ++ shift operator and shift operator
For more information about logical shift and arithmetic shift, see the quick Bi questions section. .
Previously, we saw that in C ++ standards, the behavior of the shift operator () out of the bounds is not
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
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.