当前位置:网站首页>Implicit type conversion (integer promoted part)
Implicit type conversion (integer promoted part)
2022-06-10 07:04:00 【Catzzz666】
1. The significance of plastic surgery Promotion
The integer operation of expression should be in CPU In the corresponding computing device of ,CPU Internal shaping unit (ALU) The byte length of the operand of is generally int Byte length of , It's also CPU The length of a general-purpose register . This leads to a generic CPU Difficult to achieve 8 The direct addition of bits and bytes ( Although there may be such byte addition instructions in robot instructions ), therefore , Various lengths in expressions may be less than int The integer value of the length , Must be transformed into int perhaps unsigned int, Then it can be sent in CPU Carry out operations .
2. An instance of integer promotion
char a = -1;
char b = 1;
char c = a + b;char Variables of type can only store 8 Bytes
So in storage a and b Truncation occurred

stay a and b Integer promotion occurs during addition ( Signed numbers complement sign bits , Unsigned complement 0)

Extra one 1 Give up
So it's stored in c The binary code in is 00000000
The result is 0
边栏推荐
- What should I do if I fail to withdraw cash from online gambling?
- sql 将某一列置为空
- June 9, 2022: each meeting is given a start and end time. If there is any conflict between the subsequent meeting and the previous meeting, the conflicting and previous meeting will be completely canc
- How to solve mysql1045 and find the prompt is not an internal command
- Wechat team sharing: how the wechat background does not crash under massive concurrent requests
- 一本通1258.数字金字塔 题解 动态规划
- Applet: get the current page routing information through getcurrentpages
- 3DMAX Dragon
- [width first search] the shortest path in leetcode1091 binary matrix
- 【宽度优先搜索】LeetCode1091二进制矩阵中的最短路径
猜你喜欢

「动态规划」0/1背包问题

Tensorflow experiment IX ---------- Titanic

Embedded development | common operations of EEPROM driver code

8-1 unsafe file download principle and case demonstration

『Three.js』起飞!

Chenxi bookkeeping book for bookkeeping, and use items to view accounts

How R language uses ggplot2 to draw QQ graph and box graph

YoseZang 原创 特征码定位器 SignatureTest V6.36 Rls 发布

"Three.js" take off!

Matlab: polynomial representation and its basic operations
随机推荐
Address of the original blog
leetcode. 38 --- appearance series
Arduino configuring esp32 development environment
Ros2+gazebo11+car+opencv line patrol recognition and speed steering control learning
Embedded development | common operations of EEPROM driver code
Shardingsphere practice (6) - elastic scaling
TeleyeControlor V8.69 重构键盘记录功能发布 By:Yose
loj10131. 「一本通 4.4 例 2」暗的连锁 题解 树上差分(边差分)
Nextcloud internal server error the server cannot complete your request workaround
Why can't lldb print view bounds? - Why can't LLDB print view. bounds?
【宽度优先搜索】LeetCode1091二进制矩阵中的最短路径
mongo,mongodb优化思路
Principe de l'algorithme d'extraction de l'ensemble d'éléments fréquents associés à l'alarme dans le cadre de l'exploitation et de l'entretien intelligents
P1073 [NOIP2009 提高组] 最优贸易 题解 分层图最短路
RT-Thread设计与实现:RT-Thread 概述和架构
Opengauss database ODBC environment connection configuration (Windows)
How to get the small icon in the title on the website
Summary of CUDA parallel computing optimization strategies
findfont: Font family [‘msyh‘] not found. Falling back to DejaVu Sans.
Applet: scroll to the top of the page or an element position