I wrote the following program to compute pi. The problem is that I want to show more than 16 decimal places worth of accuracy and the out put shows the 16 decimal places and the remaining places set by 'setprecision' are filled with zeros.
The code:
#include<iostream>
#include<iomanip>
#include<cmath>
The output:
Calculate the value of pi using a transformation of the Madhava-Liebniz series.
pi = 3.1415926535897931000
k = 30
Press any key to continue . . .
Notice the zeros from 17th to 20th decimal place. I would like to see this go to 40 decimal places. If anyone can offer any advice, I'd appreciate it.