当前位置:网站首页>二进制操作
二进制操作
2022-07-02 17:50:00 【悠然少年心】
#include<stdio.h>
int main()
{
char a = 2; //char占一个字节这里就是:
//0000 0002
char b = -2;
//1000 0002
//原码:
//1111 1111-0111 1111 -127 127
//反码:
//正数的反码就是本身,负数的反码就是负号不变其余全部取反
//补码
//正数的补码就是本身,负数的补码是他的反码+1
//在C里面呢实际上是用补码进行计算的
//1+(-1)
//-1反码 1000 0001=》1111 1110 -1补码: 1111 1111
// 1111 1111+0000 0001= 1 0000 0000 去掉第八个0最高位然后把1拿过来 1000 0000 //128 但是由于是溢出的所以是-128
}
边栏推荐
- 性能测试如何创造业务价值
- What are the links of the problem
- After 22 years in office, the father of PowerShell will leave Microsoft: he was demoted by Microsoft for developing PowerShell
- promise 和 Observable 的区别
- Novice must see, click two buttons to switch to different content
- Singapore summer tourism strategy: play Singapore Sentosa Island in one day
- 消息队列消息丢失和消息重复发送的处理策略
- 谷歌官方回应:我们没有放弃TensorFlow,未来与JAX并肩发展
- Leetcode (81) -- search rotation sort array II
- Ali was wildly asked by the interviewer on three sides. Redis dared not write 'proficient' on his resume anymore
猜你喜欢
Responses of different people in technology companies to bugs | daily anecdotes
仿京东放大镜效果(pink老师版)
LightGroupButton* sender = static_ cast<LightGroupButton*>(QObject::sender());
ICDE 2023|TKDE Poster Session(CFP)
Excel如何进行隔行复制粘贴
性能测试如何创造业务价值
使用CLion编译OGLPG-9th-Edition源码
How to copy and paste interlaced in Excel
LightGroupButton* sender = static_cast<LightGroupButton*>(QObject::sender());
如何清理废弃pv和其对应的文件夹
随机推荐
R语言dplyr包filter函数筛选dataframe数据、如果需要筛选的数据列(变量)名称中包含引号则需要使用!!sym语法处理、否则因为无法处理引号筛选不到任何数据
R语言ggplot2可视化:gganimate包创建动态柱状图动画(gif)、使用transition_states函数在动画中沿给定维度逐步显示柱状图
How to use PS to extract image color and analyze color matching
Redis (7) -- database and expiration key
新加坡暑假旅游攻略:一天玩转新加坡圣淘沙岛
【JVM调优实战100例】03——JVM堆调优四例
学习八股文的知识点~~1
高频面试题
Chain game system development (unity3d chain game development details) - chain game development mature technology source code
材质UV遮罩的技巧
使用CLion编译OGLPG-9th-Edition源码
SLAM|如何时间戳对齐?
Page title component
消息队列消息丢失和消息重复发送的处理策略
性能测试如何创造业务价值
MySQL advanced learning summary 7: MySQL data structure - Comparison of hash index, AVL tree, B tree and b+ tree
Meta universe chain game system development (logic development) - chain game system development (detailed analysis)
2022编译原理期末考试 回忆版
R language ggplot2 visualization: visualize the line chart and add customized X-axis label information to the line chart using labs function
How to enable the run dashboard function of idea