A spigot algorithm is a type of algorithm used to compute the value of a mathematical constant such as π or e. Spigot algorithms are unique because they do not require the total number of digits to be fixed beforehand, and do not require the computation of several intermediate results which are combined to produce the final result. There are two kinds of spigot algorithms: (1) those that can produce a single, arbitrary digit (also called digit extraction algorithm); and (2) those that produce a sequence of digits, one after the other. The Bailey-Borwein-Plouffe formula is a digit extraction algorithm for n which produces hexadecimal digits.
展开▼