sizeof long double and precision not matching?

前端 未结 4 1554
攒了一身酷
攒了一身酷 2020-12-19 03:20

Consider the following C code:

#include 
int main(int argc, char* argv[]) 
{
    const long double ld = 0.12345678901234567890123456789012345L         


        
4条回答
  •  情书的邮戳
    2020-12-19 03:40

    The sizeof operator returns the size in bytes of the data type. The floating point format types are not really comparable to the byte size of the data type, other that bigger size usually means better precision.

提交回复
热议问题