Fibik pisze:10 bajtów, ale zaokrąglone do 12, z typowym ustawieniem data align do 4.
Dla align ustawione na 8 będzie tam 16.
1 + 15 + 64 = 80 bitów.
znak + eksponent + mantysa.
double ma chyba 52 bity na mantysę, ale 53 precyzji, bo najstarszy bit jest tam zawsze 1, więc go nie zapisujemy.
Jak już mówiłem, rozmiar zależy od implementacji:
Wikipedia pisze:
On the x86 architecture, most C compilers implement long double as the 80-bit extended precision type supported by x86 hardware (sometimes stored as 12 or 16 bytes to maintain data structure alignment), as specified in the C99 / C11 standards (IEC 60559 floating-point arithmetic (Annex F)). An exception is Microsoft Visual C++ for x86, which makes long double a synonym for double. The Intel C++ compiler on Microsoft Windows supports extended precision, but requires the /Qlong‑double switch for long double to correspond to the hardware's extended precision format.
Compilers may also use long double for a 128-bit quadruple precision format, which is currently implemented in software.
Standard C++11:
Standard C++11 pisze:
3.9.1
There are three floating point types: float, double, and long double. The type double provides at least
as much precision as float, and the type long double provides at least as much precision as double.
The set of values of the type float is a subset of the set of values of the type double; the set of values
of the type double is a subset of the set of values of the type long double. The value representation of
floating-point types is implementation-defined.