/*************************************************************************** * Title: ugly_pi.cc, small program to demonstrate the use of automatic * intendation, compiler, * debug and optimization options and the gdb: * computation of pi by power series for arctan(x) for x=1: * * pi/4 = sum_{n=0}^\infty (-1)^n / (2n+1) * * Date: 17.10.2007 * Copyright: Bernard Haasdonk ***************************************************************************/ #include using namespace std; int main(int argc, char** argv) { if (argc==2) { int N = atoi(argv[1]); // dummy loop without any result as tmp is not used afterwards: double tmp; for (int i=0;i