printf("%Lf", long double) truncates the output to double. Or, am I doing something wrong?
Gcc 9.3.0 Ubuntu 20.04.2, Linux 5.8.0-59-generic
printf("print m_pi %.45f\n", M_PI);
printf("print m_pil %.45LF\n", M_PIl);
printf("maple Pi 3.141592653589793238462643383279502884197\n");
printf("m_pil def 3.141592653589793238462643383279502884L\n");
Output:
print m_pi 3.141592653589793115997963468544185161590576172
print m_pil 3.141592653589793238512808959406186204432742670
maple Pi 3.141592653589793238462643383279502884197
m_pil def 3.141592653589793238462643383279502884L
It seems like gcc printf is truncating long double to 13 digits +-.