Skip to main content
Formatting
Source Link
Gareth
  • 11.4k
  • 1
  • 36
  • 85

Ruby - 54 chars

def a()p=0;1000000.times{|i|p+=8/(4i(4*i+2))};p;end;

def a()p=0;1000000.times{|i|p+=8/(4*i*(4*i+2))};p;end;

My first try on console

def a()i=1;p=0;while i<2**100 do p+=8/(i*(i+2));i+=4;end;p;end;

def a()i=1;p=0;while i<2**100 do p+=8/(i*(i+2));i+=4;end;p;end;

63 chars.

Ruby - 54 chars

def a()p=0;1000000.times{|i|p+=8/(4i(4*i+2))};p;end;

My first try on console

def a()i=1;p=0;while i<2**100 do p+=8/(i*(i+2));i+=4;end;p;end;

63 chars.

Ruby - 54 chars

def a()p=0;1000000.times{|i|p+=8/(4*i*(4*i+2))};p;end;

My first try on console

def a()i=1;p=0;while i<2**100 do p+=8/(i*(i+2));i+=4;end;p;end;

63 chars.

Source Link
Perello
  • 101
  • 1

Ruby - 54 chars

def a()p=0;1000000.times{|i|p+=8/(4i(4*i+2))};p;end;

My first try on console

def a()i=1;p=0;while i<2**100 do p+=8/(i*(i+2));i+=4;end;p;end;

63 chars.