当前位置:网站首页>C language learning journey [operator (incomplete version)]
C language learning journey [operator (incomplete version)]
2022-08-10 01:26:00 【51CTO】
1.1 算术操作符
- 除号
To print floating point,Requires float on the sign side,且数据类型为double或者float类型
- 取模
//取模操作符 Both ends of must be integers
1.2 移位操作符
- 左移/右移操作符
Shift bits left/右移动 n位
right shift fill:Arithmetic right shift complements the original sign bit;Logical right shift complement0
原码 ----(符号位不变,其他位按位取反)----> 反码 ----(反码+1)---->补码
1.3 位操作符
& 按位与:同1则1,其余为0
| 按位或 :有1则1 ,无1则0
^ 按位异或 :相同为0, 相异为1
备注:Their operands must all be integers!
- 实例1.交换两个数
总结:
a ^ a = 0
a ^ b ^ b = a
1.4 单目操作符
!逻辑取反
sizeof The expressions in it do not participate in the operation
~ 按位取反 --> -1的补码是32位全1
边栏推荐
猜你喜欢
随机推荐
FreeRTOS任务基础
Alibaba Cloud SMS Service Activation
Eureka protects itself
直播app开发搭建,flutter 实现自适应、自动换行、相对布局
What are the Shenzhen fortress machine manufacturers?Which one do you recommend?
JS基础笔记-关于对象
Impala 疑问
数字孪生电力系统,可视化应用实现科学调度的电子设备
go语言的并发原理(goroutine)
nfs配置
HStreamDB v0.9 发布:分区模型扩展,支持与外部系统集成
拼多多店铺运营不得不知的留个运营小知识
GoLang 使用 goroutine 停止的几种办法
深入理解Aarch64内存管理
arm-4-裸板开发
mysql无法远程连接 Can‘t connect to MySQL server on ‘xxx.xxx.xxx.xxx‘ (10060 “Unknown error“)
JSP简介
【诗歌】爱你就像爱生命
ABAP中Collect的用法
NTU General Database-Gbase-8a-Learning-04-Deploying Distributed Clusters









