I need to print the result of a program with 20 significant digits, but I do not know how to print more than 15 digits (long format). Is there any way to achieve this?
You can control the printf output format as in C by following this with these format specifiers :
printf
> printf('%.20f\n', pi) 3.14159265358979311600