当前位置:网站首页>Integer lifting example
Integer lifting example
2022-06-11 09:43:00 【Life is made by oneself ~】
1️⃣ Integers are all in memory 32 A bit , It's just that if it is char Truncation occurs for this type of ( Be careful to convert it into a complement )
2️⃣ Integer promotion depends on type promotion signed Just add the sign bit unsigned char Just add 0
3️⃣ A positive number 、 back 、 Complement the same
int main()
{
char a = -1;
signed char b = -1;
unsigned char c = -1;
printf("a = %d, b = %d, c = %d", a, b, c);
return 0;
}
To do this problem, you must first know signed char and unsigned char The scope of the
signed char

unsigned char

So I'm looking at this problem , Use all three %d In the form of printing , So there will be plastic improvement
char a:
signed char and char It is equivalent. 
answer -1 , -1, 255
int main()
{
char a = -128;
char b = 128;
printf("%u\n", a);
printf("%u\n", b);
return 0;
}


answer : 4294967168, 4294967168
int main()
{
int i = -20;
unsigned int j = 10;
printf("%d\n", i + j);
return 0;
}
We need to know the priority order before we do this problem
long double
double
float
unsigned long int
long int
unsigned int
int

Operate in the form of complement , Finally, it is formatted as a signed integer
answer : -10
边栏推荐
- 1400. construct K palindrome strings
- 1854. the most populous year
- Flask (III) -- variable rules
- 等待事件 enq: KO - fast object checkpoint可行的一些处理方法
- ESP8266_SmartConfig
- The first TOF related data set available for deep learning: deep learning for confidence information in stereo and TOF data fusion (iccv 2017)
- Augmented reality experiment IV of Shandong University
- The mobile terminal page uses REM for adaptation
- Modularnotfounderror: no module named 'find_ version’
- Oracle DG physical standby database uses alias data file to change path to OMF path
猜你喜欢

Modularnotfounderror: no module named 'find_ version’

不同CV任务的标注类型

ORACLE DG物理备库使用别名数据文件改变路径到OMF路径

LeetCode刷题 —— 手撕二叉树

document对象

Exclusive interview - dialogue on open source Zhai Jia: excellent open source projects should be seen by more people. I am honored to participate in them

卸载grid时运行脚本报错Can‘t locate Env.pm in @INC
![[ROS] noedic moveit installation and UR5 model import](/img/bc/865c752021a4ee68e963c09f5f632d.png)
[ROS] noedic moveit installation and UR5 model import

报错device = depthai.Device(““, False) TypeError: _init_(): incompatible constructor arguments.

js中关键字this的理解
随机推荐
Detailed explanation of the difference between construction method and method
The mobile terminal page uses REM for adaptation
Fabric. JS dynamically set font size
Flask (I) - quick start
Package details
MSF SMB based information collection
报错device = depthai.Device(““, False) TypeError: _init_(): incompatible constructor arguments.
等待事件 enq: KO - fast object checkpoint可行的一些处理方法
Oracle XDB组件的重建
P4147 "jade toad Palace"
Detailed explanation of this and static
Day44 database
2022 must have Chrome extension - browser plug-in to double your Internet efficiency
赛灵思引脚约束文件 .xdc
Analysis of Kube scheduler disk scheduling source code
FPGA基础架构【参考ug998】
Simple recommendation based on Euclidean distance
Image quality evaluation including Matlab source code
CVE-2021-40449 NtGdiResetDC UAF
js基础--运算符