c中的浮点数存储

时间:2013-11-21 12:47:16

标签: c floating-point floating-accuracy

以下是我的代码

#include<stdio.h>
int main( void )

{
    double dInput = 0.7;        
    printf("\n %.17f ",dInput);
    return 0;
}

我得到的输出是0.69999999999999996而不是0.7

任何人都可以解释为什么会这样。

0 个答案:

没有答案