当前位置:网站首页>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 .
边栏推荐
- Global and Chinese markets for electroencephalogram (EEG) devices 2022-2028: Research Report on technology, participants, trends, market size and share
- Backpropagation formula derivation [Li Hongyi deep learning version]
- Key knowledge of embedded driver
- Global and Chinese market of thin film deposition systems 2022-2028: Research Report on technology, participants, trends, market size and share
- Latex tips slash \backslash
- Imperial cms7.5 imitation "D9 download station" software application download website source code
- Record a problem that soft deletion fails due to warehouse level error
- Key knowledge of C language
- [Yugong series] February 2022 attack and defense world advanced question misc-83 (QR easy)
- Experience summary of the 12th Blue Bridge Cup (written for the first time)
猜你喜欢

WP collection plug-in free WordPress collection hang up plug-in

Tsinghua University product: penalty gradient norm improves generalization of deep learning model

Redis notes (I) Linux installation process of redis

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

1day vulnerability pushback skills practice (3)

96% of the collected traffic is prevented by bubble mart of cloud hosting

Practical multifunctional toolbox wechat applet source code / support traffic master

C language black Technology: Archimedes spiral! Novel, interesting, advanced~

Johnson–Lindenstrauss Lemma
![Measurement fitting based on Halcon learning [4] measure_ arc. Hdev routine](/img/3a/cf6285ae1c01bda42874eeca9fe5b1.jpg)
Measurement fitting based on Halcon learning [4] measure_ arc. Hdev routine
随机推荐
How to use STR function of C language
ZABBIX API batch delete a template of the host
Optimization theory: definition of convex function + generalized convex function
Create real-time video chat in unity3d
Dans la recherche de l'intelligence humaine ai, Meta a misé sur l'apprentissage auto - supervisé
Setting methods, usage methods and common usage scenarios of environment variables in postman
Keepalived set the master not to recapture the VIP after fault recovery (it is invalid to solve nopreempt)
Keep an IT training diary 055- moral bitch
Global and Chinese market of contour projectors 2022-2028: Research Report on technology, participants, trends, market size and share
Database concept and installation
C learning notes: C foundation - Language & characteristics interpretation
[Wu Enda deep learning] beginner learning record 3 (regularization / error reduction)
There is no need to authorize the automatic dream weaving collection plug-in for dream weaving collection
Recent learning fragmentation (14)
Unity writes a character controller. The mouse controls the screen to shake and the mouse controls the shooting
Experience summary of the 12th Blue Bridge Cup (written for the first time)
A brief talk on professional modeler: the prospect and professional development of 3D game modeling industry in China
Slurm view node configuration information
JS object definition
Gee import SHP data - crop image