Relive integersThere are two types of ECMAScript integers, signed integers (which allow positive and negative numbers), and unsigned integers (only positive numbers are allowed). In ECMAScript, all integer literals are signed integers by default.
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 operators
Bitwise operators allow placement of the bits specified in the integer number. If both the left and right arguments are strings, the bitwise operator will manipulate the ASCII value of the character.
Do not move more than 32 bits
Bitwise operators allow us to manipulate a single "bit" in the primary data type of an integer, that is, bits. The bitwise operator performs a Boolean algebra on the corresponding bits in the two arguments and eventually produces a result.Bitwise
We've explained PHP arithmetic operators, PHP string operators, assignment operators, and today we'll give you a detailed introduction to the PHP operator
"bitwise operator"。
Bit operators are not often used in PHP, but they are still very useful,
Control hardware often involves opening/closing specific bits or viewing their status. The bitwise operator (>,~,&,|,^) provides this capability. In the following example, Lottabits represents a value, bit represents the value of a special location.
Tag: XOR represents print AMP analysis based on nbsp operation conversionThe bitwise operator is primarily for binary, and it includes: "and", "or", "XOR".1. With operator (& representation)The operation rules are as follows:The two operands have a
Bit arithmetic notThe bitwise operation not is represented by a negative number (~), which is one of the few operators related to binary arithmetic in ECMAScript.Bitwise arithmetic NOT is a three-step process:1. Convert the operand to a 32-digit
------Java Training, Android training, iOS training,. NET training, look forward to communicating with you! -------"#include指令"1. The file contains the format of the command:1) #include "" Double quotation marks are files that contain the user's own
1. Not
Bit operators not from ~ The essence of the. Not operator is to calculate a negative number and then subtract 1.
The bitwise operator not is a three-step process.
A. Convert the operator to a 32-bit number.
B. Convert the
in PHP, "|" is a PHP bitwise operator, "| |" As a logical operator
Bit operator Code:
$a = 0;
$b = 0;
if ($a =3 | $b =3) {
$a + +;
$b + +;
}
echo $a. ', '. $b; Output
?>
Compare the code with the following code for the logical operator:
$a = 0;
$b
1. Expression: The expression is judged to have no result (value), the simplest expression is a constant or variable, such as: A, A, 3 + 1, a + B, a + 5 are expressions2.BOOL (Boolean) data type: In addition to the basic data types in the C language,
C language-bitwise operator, C language-OperatorI. bitwise operators 1. bitwise AND :&
1> Functions
* The result bit is 1 only when the corresponding two binary bits are 1. Otherwise, the result bit is 0.
* Example: 10 is represented as 1010 in
Six bitwise operators & | ^ ~ <> & Bitwise AND operator: Calculate the location and binary length of a binary short value, that is, 1 & 1 = 1 & 0 = 0 0 & 0 = 0 | Press bitwise parallel operators perform parallel operations based on the position and
Bitwise OperatorsJava defines a number of bitwise operators that can be applied to integer types Long,int,short,char and byte.Bitwise operators are performed on BITS and perform bitwise operations. Suppose a = 60 and B =; now in binary format, they
4.1.2 Bitwise operators& and | Operators also have a role in performing operations on numeric values. When used in this way, they deal with a series of bits stored in a variable, rather than variable values, so they are called bitwise
Transferred from: http://blog.sina.com.cn/s/blog_74a459380101d6xl.htmlThe XOR operator, ∧, is also called. The rule is that if the two binary numbers of the operation are the same, the result is 0 (false); The XOR is 1 (true). That is 0∧0=0,0∧1=1,1∧1
Most languages provide bitwise operators, which are widely used in languages such as c,c++, while there are not many application examples in scripting languages such as Js,as, and the appropriate use of bitwise operators can be a good result.Below
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.