PHP Function: Pi

August 11th, 2006

Just randomly came up with this after reading about how pi was first discovered and calculated. Im thinking of writing code that calculates pi to many decimals but figuring this out was hard enough lol.


<?php

Function mypi (){

return (16*(atan(1/5)) - (4*atan(1/239)));

}

?>

Can be proved true when tested against php’s own Pi fucntion.

¬ SHARE

Tags: , , , ,

Leave a Reply

Those who are crazy enough to think they can change the world, usually do – Unknown

Link Love

  • BubblesSOC

About Photogabble

Photogabble has been developed, edited and written by Simon Dann. Simon is a 22 year old post-grad Communication, Culture & Media student, currently studying for his Masters.

Like this Website?

If you like this website you can subscribe to the feed, or recieve email updates.

TwitterCounter for @carbontwelve