x=0;(0..9**6).each{|e|x+=(-1.0)**e/(2*e+1)*4}; p x
Standard input is empty
3.141590771916799
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!