exact representation of floating points in c

前端 未结 9 933
离开以前
离开以前 2020-12-01 17:40
void main()
{
    float a = 0.7;

    if (a < 0.7)
        printf(\"c\");
    else
        printf(\"c++\");
} 

In the above question for 0.7, \"

9条回答
  •  情歌与酒
    2020-12-01 18:08

    The internal representation is IEE754.

    You can also use this calculator to convert decimal to float, I hope this helps to understand the format.

提交回复
热议问题