当前位置:网站首页>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
边栏推荐
- EL表达式
- 拒绝“重复造轮子”,百度EasyDL让你玩转AI定制开发
- 《动手学深度学习》(八) -- 多尺度标检测和单发多框检测
- 共创 Ray 中文社区,Ray Forward Meetup 2022 直播邀你参加!
- 首席信息官如何将可持续性和技术结合起来
- redis distributed lock code example
- Wireshark classic practice and interview 13-point summary
- selenium和驱动安装
- Golden Warehouse Database KingbaseGIS User Manual (6.4. Geometry Object Access Function)
- 下载markdown软件Obsidian(解决官网下载速度慢)
猜你喜欢
安全知识培训——消防安全
The latest "Grain Academy Development Tutorial" in 2022: 10 - Front-end payment module
CST Studio Suite 2021软件安装包和安装教程
防火墙之系统防护
Qt 之 QDateEdit 和 QTimeEdit
Golden Warehouse Database KingbaseGIS User Manual (6.4. Geometry Object Access Function)
下班后用微信处理工作时发病身亡,法院判决:工伤!
了解什么是架构基本概念和架构本质
Service Discovery @EnableDiscoveryClient
【SSL集训DAY2】Sort【树状数组】
随机推荐
JS基础笔记-关于对象
基于ABP的AppUser对象扩展
基于 LSTM 的分布式能源发电预测(Matlab代码实现)
数字孪生智慧制造生产线项目实施方案,平台认知与概念
构建平衡二叉树「建议收藏」
New window Display Agreement
[C language] In-depth understanding of pointers and arrays (issue 4)
61.【快速排序法详解】
Eureka自我保护
LeetCode952三部曲之三:再次优化(122ms -> 96ms,超51% -> 超91%)
YOLOV5学习笔记(七)——训练自己数据集
arm-4-裸板开发
EL表达式
第十二,十三章 mysql数据类型,视图的课后练习
数字孪生电力系统,可视化应用实现科学调度的电子设备
【哲理】读书的意义
直播间搭建,按钮左滑出现删除等操作按钮
ECCV 2022 | Microsoft Open Source TinyViT: Pre-training Capabilities for Small Models
KingbaseGIS Jin Cang database using manual (6.3. Geometric object creation function)
dlopen failed: library “libtaml.so“ not found