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
Before you understand the displacement, look at the binary representations and relationships of positive and negative numbers:Example 15 and-15:15 The original code: 00000000 00000000 00000000 00001111Complement: 11111111 11111111 11111111 11110000+1
Discussion on bitwise operators and displacement operations, and operator displacement operations
I have never understood how to calculate this, because I have never used it before, but now I want to understand it, so it is a good idea to understand
http://aokunsang.iteye.com/blog/615658Prelude:Yesterday a buddy asked me Java displacement you will, I said no, think about displacement so troublesome, generally have displacement Java code will not look, there are a few people would ah, right? But
The topics are as follows:
Description
The Hamming distance is the number of bits in the binary case where an integer becomes another integer that needs to be flipped. For example 2 conversion to 3 requires flipping 1
and Operations &
Example:3&5Solution: 3 of the twos complement is 11, 5 is 101, 3&5 is 011&101, first look at the hundred (actually not the hundred, so it is easy to understand) a 1 1, according to (1&1=1,1&0=0,0&0=0,0 &1=0) that the hundred
It has to be said that the application of bit arithmetic is very ingenious.This problem asks for a continuous interval integer and the value of the operation, the breakout point lies in the continuous interval of this feature. We can find a few
1. The meaning of the return value in a call to a functionFunction F1 () {echo 1234;Return 123;//here to handle the returned value}Var_dump (F1 ());//Here is an understanding of the entire return value "function calls without a return value will not
Assignment operatorsThe PHP assignment operator is used to write values to variables. The base assignment operator in PHP is "=".This means that the right-hand copy expression sets the value for the left-hand operand._________________________________
Bitwise operations can often make incredible things. For example, how can we exchange two numbers without a temporary variable? One person who has never been familiar with such problems cannot think of it. If we use go as a metaphor, bitwise
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.