can’t print correctly a long double in C

There’s a similar problem with MinGW under Windows. If that’s not what you’re using, this answer probably doesn’t apply. The problem is that the compiler (GCC) and the runtime library (Microsoft’s) are implemented by different groups that happen to have different ideas about how the type long double should be represented. (gcc uses 128 bits … Read more

long double vs double

Quoting from Wikipedia: On the x86 architecture, most compilers implement long double as the 80-bit extended precision type supported by that hardware (sometimes stored as 12 or 16 bytes to maintain data structure . and Compilers may also use long double for a 128-bit quadruple precision format, which is currently implemented in software. In other … Read more