long double has 16 bytes, 12 bytes, and 8 bytes, of which 16 bytes account for the majority. Because the ANSI C standard does not specify the exact precision of long double, there may be different requirements for different platforms. accomplish.
#The operating environment of this article: Windows7 system, C, Dell G3.
How many bytes are long double?
long double has 16 bytes, 12 bytes, and 8 bytes. Among them, 16 bytes account for the majority.
long double is a data type in the computer programming language C language and C language.
long double (multiple-precision floating-point type or long-precision floating-point type) long double is the "keyword" of the C language standard revised in 1999. Long double is used in C language and C language library functions. vocabulary, but the handling of long double depends on the compiler.
ANSI C standard stipulates that double variables are stored as IEEE 64-bit (8 bytes) floating point values, but does not specify the exact precision of long double.
So there may be different implementations for different platforms.
Some are 8 bytes, some are 10 bytes, some are 12 bytes or 16 bytes.
It is stipulated that the precision of long double is not less than the precision of double, just like int and long int.
Regarding the specific compiler situation, you can print sizeof(long double) to know.
For more related knowledge, please visit the FAQ column, or study "c Language Tutorial"
The above is the detailed content of How many bytes are long double. For more information, please follow other related articles on the PHP Chinese website!