#include <stdio.h> int main( void ) { double sum = 0; for( unsigned i=0; ; ++i ) { sum += (1.0-i%2*2)/(2*i+1); if( 1.0/(2*i+1) < 1e-6 ) break; } printf( "%f\n", sum ); }