unsigned int负数表示和验证
来源:互联网 发布:足球滚球大小球软件 编辑:程序博客网 时间:2024/05/18 03:47
// DateTest.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
unsigned int i=3;
cout<<i * -1;
//输入是:4294967293
return 0;
}
/*
结果分析:
unsigned int -3
对于有符号整形的最后一位作为符号位,0表示正数 1表示负数
对于负数的存放,计算机采用补码的方式(正数是源码(其实正数的补码就是源码))
负数补码也就是原数除符号位外依次求反然后再加1
1000 0000 0000 0000 0000 0000 0000 0011
补码:
1111 1111 1111 1111 1111 1111 1111 1101 = 4294967293
和结果一样的
*/
- unsigned int负数表示和验证
- mysql int unsigned负数问题
- Unsigned int 能存储负数?
- Unsigned int 能存储负数?
- unsigned int 和int
- int 和 unsigned int
- 用表达式来表示int 和 unsigned int 所能表示的最大值
- unsigned 和 int
- int 和 unsigned
- int,long int, unsigned int,unsigned long int,long long的表示范围问题(转)
- 探讨int和unsigned能表示的最大的数和最小的数
- 探讨int和unsigned能表示的最大的数和最小的数
- size_t 和 unsigned int, unsigned long
- int和unsigned int解析和扩展
- 挖一挖unsigned int和补码
- 挖一挖unsigned int和补码
- 【C++】unsigned int和补码
- int和unsigned int的区别- -
- Oracle 跨操作系统 迁移 说明
- 在ASP/ASP.NET 中处理客户端数字证书
- .NET中如何操作数字证书详解
- RHEL5上安装nagios
- 如何进行教练辅导
- unsigned int负数表示和验证
- 题目:求1+2!+3!+...的前n项的和
- js中怎么取所有分页中的值
- 昨天网站挂了,qiu解决方案,该怎么处理
- ORA-04031: unable to allocate 4096 bytes of shared memory
- ext 合并行 ,如何实现?
- jquery ajax post提交成功后回调函数不执行(IE环境下)
- goldengate Linux平台Oracle RAC-Oracle
- goldengate使用ASM存放trail文件注意事项