当前位置:网站首页>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
边栏推荐
猜你喜欢
go语言的并发原理(goroutine)
大龄测试员刚迈过了 35 岁这个“坎儿”,和大家说点儿心里话
Golden Warehouse Database KingbaseGIS User Manual (6.5. Geometry Object Editing Function)
Distributed database problem (3): data consistency
恭喜获奖得主 | 互动有礼获赠 Navicat Premium
Description of AirFlow
Eureka自我保护
YOLOV5 study notes (7) - training your own data set
Golden Warehouse Database KingbaseGIS User Manual (6.4. Geometry Object Access Function)
【C语言】通讯录《静态内存版本》
随机推荐
信息系统项目管理师核心考点(六十四)信息安全基础知识重要概念
【诗歌】爱你就像爱生命
【SSL集训DAY2】Sequence【数学】
Jpa 查询view or 无主键的table
AUTOCAD——形位公差如何标注、CAD打断于点的操作
生成树和交换的总结
【励志】名言警句
《GB5084-2021》PDF下载
NotWritableError: The current user does not have write permissions when conda creates a new environment
Description of AirFlow
二进制、八进制、十进制、十六进制之间的转换
The latest "Grain Academy Development Tutorial" in 2022: 10 - Front-end payment module
第十五章 mysql存储过程与存储函数课后练习
NTP SERVICE TASK 在GWserver配置、启用NTP服务,为当前环境提供时钟同步服务,Client主机可以从该服务器同步时间。
断开和服务器共享连接的方法「建议收藏」
网络协议05 -网络层
CMake使用记录
FreeRTOS任务基础
【集训DAY3】阶乘【数学】
E - Sugoroku 3(期望dp)