当前位置:网站首页>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 .
边栏推荐
- Buuctf QR code
- Tsinghua University product: penalty gradient norm improves generalization of deep learning model
- Node solves cross domain problems
- Li Chuang EDA learning notes 13: electrical network for drawing schematic diagram
- Handler source code analysis
- Résumé: entropie, énergie libre, symétrie et dynamique dans le cerveau
- 機器學習基礎:用 Lasso 做特征選擇
- Network communication basic kit -- IPv4 socket structure
- POSTECH | option compatible reward reverse reinforcement learning
- Base d'apprentissage de la machine: sélection de fonctionnalités avec lasso
猜你喜欢

Dans la recherche de l'intelligence humaine ai, Meta a misé sur l'apprentissage auto - supervisé

1day vulnerability pushback skills practice (3)

Fudan released its first review paper on the construction and application of multimodal knowledge atlas, comprehensively describing the existing mmkg technology system and progress

VRRP+BFD

7 * 24-hour business without interruption! Practice of applying multiple live landing in rookie villages

What is cloud primordial?

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"

Solve the problem that the tabbar navigation at the bottom of vantui does not correspond to the page (window.loading.hash)

Setting methods, usage methods and common usage scenarios of environment variables in postman

ZABBIX API pulls the values of all hosts of a monitoring item and saves them in Excel
随机推荐
What is the difference between enterprise wechat applet and wechat applet
Key knowledge of C language
Rhcsa day 3
Record a problem that soft deletion fails due to warehouse level error
How to use STR function of C language
MySQL workbench use
Love and self-discipline and strive to live a core life
I stepped on a foundation pit today
Handler source code analysis
Zblog collection plug-in does not need authorization to stay away from the cracked version of zblog
Keep an IT training diary 054- opening and closing
In my spare time, I like to write some technical blogs and read some useless books. If you want to read more of my original articles, you can follow my personal wechat official account up technology c
Examination question bank of constructor decoration direction post skills (constructor) and examination data of constructor decoration direction post skills (constructor) in 2022
Bugku Zhi, you have to stop him
Node solves cross domain problems
在尋求人類智能AI的過程中,Meta將賭注押向了自監督學習
Mysql to PostgreSQL real-time data synchronization practice sharing
Network byte order
2022 attached lifting scaffold worker (special type of construction work) free test questions and attached lifting scaffold worker (special type of construction work) examination papers 2022 attached
Global and Chinese markets for electroencephalogram (EEG) devices 2022-2028: Research Report on technology, participants, trends, market size and share