摘要: /*总结:1.float的精度是6位有效数字,取值范围是10的-38次方到10的38次方,float占用4字节空间 double的精度是15位有效数字,取值范围是10的-308次方到10的308次方,double占用8字节空间。 浮点数相等判断; const float EPSINON = 0.00001; if ((x >= - EPSINON) && (x <= EPSINON) 大于小于直接比较 2.不要将数量级相差较大的两个浮点数相加,也不可将两个相近的浮点数相减*/#include <stdio.h>#include <ma... 阅读全文
posted @ 2011-09-14 21:10 SunnyDay2015 阅读(310) 评论(0) 推荐(0) 编辑
摘要: /*总结: 1.不要忘了溢出 2.单独处理最高位的加法更容易些。summary: 1.The overflow of addition of large numbers should be noticed. 2.It's easier to deal with the highest bit when adding,I think.*/#include <stdio.h>#include <string.h>#include <memory.h>int main(){ char srca[1000], srcb[1000]; int dsta[... 阅读全文
posted @ 2011-09-14 14:53 SunnyDay2015 阅读(370) 评论(0) 推荐(0) 编辑