This page uses Javascript Worker to run scripts in background, without affecting the performance of the page. It uses Chudnovsky algorithm with decimal.js library. Basically the page will create a new Worker passing to it the precision desired. The code will run in a separate thread (high-CPU) so that will not cause the page to freeze.
The Chudnovsky algorithm is a fast method for calculating the digits of π. It was published by the Chudnovsky brothers in 1988. Basically, the formula is:
Unlike many other programming languages, JavaScript does not define different types of numbers, like integers, short, long, floating-point etc. JavaScript numbers are always stored as double precision floating point numbers, following the international IEEE 754 standard. Therefore, it is required to use the decimal.js library.
Can your browser calculate all Pi digits?
Result