Bitwise operators allow you to evaluate and manipulate the bits specified in the integer number.
Bitwise operators
Example name result
$a & $b and (bitwise AND) will set the 1 bit in the $a and $b to 1.
$a | $b or (bitwise OR) sets any bit in the
1.NOT
The bitwise operator is not represented by ~. The essence of the not operator is to negate the number and then subtract 1.
The bitwise operator NOT is a three-step process.
A. Converting an operator to a 32-digit number
B.
1, the original code, anti-code, complement, positive subtraction of the complement of the additionJS in the binary operation, the use of 32-bit binary integers, because JS integer are signed number, the highest bit 0 for positive numbers, 1 for
Use the GII to generate several methods of the model generation for the user table to parse:Random number generationprotected function Generatesalt ($cost =) { $cost = (int) $cost; if ($cost ) { throw new
Bit encryption and decryption algorithm will convert plaintext information into binary data, and then encrypt these bits to get ciphertext. Bit encryption algorithm relies on the powerful bit processing ability of computer, which is very popular in
Arithmetic operators
Operator description
+
-
*
/
The division operator always returns a floating-point number. The exception is the following: two operands are integers
2.4 Expression evaluation and type conversionMySQL allows you to write expressions that include constants, function calls, and table-column references. These values can be grouped using different types of operators, such as arithmetic or comparison
This article to share the content is about PHP bit operation, has a certain reference value, the need for friends can refer to
$a & $b
and (Bitwise AND)
Set the 1 bit to 1.
$a | $b
or (bitwise OR)
Set the bit
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.