当前位置:网站首页>The property of judging odd or even numbers about XOR.
The property of judging odd or even numbers about XOR.
2022-07-04 03:10:00 【Kinght_ one hundred and twenty-three】
XOR can be simply understood as addition without carry , such as 2 The binary of is 10,1 The binary of is 01,1^2 As the result of the 3, Binary for 11.
Then this property can be used to judge whether odd numbers or even numbers .
The specific content
For example, an even number is 6, Its binary is 110;1 The binary of is 001, that 6^1 As the result of the 7, Binary for 111, Do all even numbers have this property ? Yes , Because the last bit of even binary must be 0, and 1 The last bit of binary must be 1, So all even XORs 1 The result is the original number plus 1 Result .
For example, an odd number is 11, Its binary is 1011,1 The binary of is 0001, that 11^1 As the result of the 10, Binary for 1010. Do all odd numbers have this property ? Yes , Because the last bit of odd binary must be 1, and 1 The last bit of binary must be 1, And because XOR operation can be understood as addition without carry , So all odd XORs 1 The result is the original number minus 1 Result .
边栏推荐
- System integration meets the three business needs of enterprises
- Libcblas appears when installing opencv import CV2 so. 3:cannot open shared object file:NO such file or directory
- Redis notes (I) Linux installation process of redis
- (practice C language every day) pointer sorting problem
- false sharing
- 3D game modeling is in full swing. Are you still confused about the future?
- Imperial cms7.5 imitation "D9 download station" software application download website source code
- Stm32bug [the project references devices, files or libraries that are not installed appear in keilmdk]
- Unity knapsack system (code to center and exchange items)
- Jenkins configures IP address access
猜你喜欢

Ai aide à la recherche de plagiat dans le design artistique! L'équipe du professeur Liu Fang a été embauchée par ACM mm, une conférence multimédia de haut niveau.

Add token validation in swagger

What are the conditions for the opening of Tiktok live broadcast preview?
![[Yugong series] February 2022 attack and defense world advanced question misc-83 (QR easy)](/img/36/e5b716f2f976eb474b673f85363dae.jpg)
[Yugong series] February 2022 attack and defense world advanced question misc-83 (QR easy)

(column 23) typical C language problem: find the minimum common multiple and maximum common divisor of two numbers. (two solutions)

The first spring of the new year | a full set of property management application templates are presented, and Bi construction is "out of the box"

ZABBIX API pulls the values of all hosts of a monitoring item and saves them in Excel

Unspeakable Prometheus monitoring practice

MySQL query

在尋求人類智能AI的過程中,Meta將賭注押向了自監督學習
随机推荐
Contest3145 - the 37th game of 2021 freshman individual training match_ E: Eat watermelon
2022 examination summary of quality controller - Equipment direction - general basis (quality controller) and examination questions and analysis of quality controller - Equipment direction - general b
Stm32bug [the project references devices, files or libraries that are not installed appear in keilmdk]
PID of sunflower classic
Dans la recherche de l'intelligence humaine ai, Meta a misé sur l'apprentissage auto - supervisé
[development team follows] API specification
Buuctf QR code
Contest3145 - the 37th game of 2021 freshman individual training match_ 1: Origami
Code Execution Vulnerability - no alphanumeric rce create_ function()
Contest3145 - the 37th game of 2021 freshman individual training match_ F: Smallest ball
Advanced learning of MySQL -- Application -- index
I stepped on a foundation pit today
PHP database connection succeeded, but data cannot be inserted
There is no need to authorize the automatic dream weaving collection plug-in for dream weaving collection
Cache general management class + cache httpcontext Current. Cache and httpruntime Differences between caches
Problems and solutions of several concurrent scenarios of redis
Teach you how to optimize SQL
Network communication basic kit -- IPv4 socket structure
I stepped on a foundation pit today
C language black Technology: Archimedes spiral! Novel, interesting, advanced~