Last Updated: February 25, 2016
· donutdan4114
Drupal logo 1

Calculating Pi using JavaScript

During my time calculating Pi using PHP ( http://coderwall.com/p/g35wya?i=1&p=1&q= ), I decided it was time to try it with JavaScript.

Here is the jsFiddle: http://jsfiddle.net/WfpzT/4/

This script will allow you to enter an accuracy number and then calculate Pi using that number of iterations. The higher the accuracy, the more accurate your Pi calculations will be.

More information about this method of calculating Pi can be found here: http://en.wikipedia.org/wiki/Leibniz_formula_for_%CF%80

Say Thanks