Do I have a gcc optimization bug or a C code problem?

前端 未结 9 2127
借酒劲吻你
借酒劲吻你 2021-02-06 00:57

Test the following code:

#include 
#include 
main()
{
    const char *yytext=\"0\";
    const float f=(float)atof(yytext);
    siz         


        
9条回答
  •  梦如初夏
    2021-02-06 01:47

    Why would you think that t should be 0?

    Or, more accuractely phrased, "Why would you think that the binary representation of a floating point zero would be the same as the binary representation of an integer zero?"

提交回复
热议问题