摘要: 读《深入理解计算机系统》 第二章 信息的表示与处理检查2个无符号数相加是否溢出1 bool checkUAddOverflow(unsigned int x,unsigned int y)2 {3 return x+y 0; 5 bool pos = x>=0 && y>= 0 && sum 0 && sum > 0; 5 bool pos = x>=0 && y0) && (x-y > 0 == x<0); //x==0要和y<0在一组13 }检查2个整数相乘是否溢出 1 阅读全文
posted @ 2013-08-30 20:42 _pop 阅读(517) 评论(0) 推荐(0) 编辑