Chinaunix首页 | 论坛 | 博客
  • 博客访问: 271801
  • 博文数量: 101
  • 博客积分: 4245
  • 博客等级: 上校
  • 技术积分: 1085
  • 用 户 组: 普通用户
  • 注册时间: 2009-04-24 00:28
文章分类

全部博文(101)

文章存档

2012年(1)

2011年(16)

2010年(34)

2009年(50)

我的朋友

分类:

2010-11-04 11:30:37

The C standard provides that a float has to be able to represent at least six significant figures and allow a range of at least 10-37 to 10+37. The first requirement means, for example, that a float has to represent accurately at least the first six digits in a number such as 33.333333. The second requirement is handy if you like to use numbers such as the mass of the sun (2.0e30 kilograms), the charge of a proton (1.6e–19 coulombs), or the national debt. Often, systems use 32 bits to store a floating-point number. Eight bits are used to give the exponent its value and sign, and 24 bits are used to represent the nonexponent part, called the mantissa or significand, and its sign.
 
 
非特别指明输出格式,printf输出的float和double数小数位是6位
阅读(933) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~