Thursday, March 14, 2019

Happy Pi Day!

(Borrowed from Connor McDonald's Twitter account.)

SQL> select
  2    sum((
  3    4 / (8*(level-1)+1) -
  4    2 / (8*(level-1)+4) -
  5    1 / (8*(level-1)+5) -
  6    1 / (8*(level-1)+6)
  7    ) / power(16,level-1)) pi
  8  from dual connect by level <= 10;

        PI
----------
3.14159265