exact representation of floating points in c

前端 未结 9 946
离开以前
离开以前 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:09

    Another good resource to see how floating point numbers are stored as binary in computers is Wikipedia's page on IEEE-754.

提交回复
热议问题