Skip to content

paul-reiners/quadrillionth-decimal-place

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

quadrillionth-decimal-place

An implementation in C of the Bailey–Borwein–Plouffe (BBP) formula that allows you to compute an arbitrary hexadecimal digit of pi without computing any of the preceding digits.

This is a project for HarvardX CS50x.

video on project

Overview

This project is an implementation in C of the Bailey–Borwein–Plouffe (BBP) formula. The BBP formula allows you to compute efficiently an arbitrary digit of irrational constants that can be expressed in a particular form. (See http://en.wikipedia.org/wiki/Bailey–Borwein–Plouffe_formula for more information.) In particular, this program allows you to compute arbitrary hexadecimal digits of pi and arbitrary binary digits of log(2). It is accurate out to the 100 millionth hex digit of pi. It can compute the millionth digit in about 10 seconds, the 10 millionth digit in about 2 minutes and the 100 millionth digit in about 20 minutes (the BBP algorithm is linear in d where d is the digit place). I used the GNU MP Bignum Library to achieve this level of precision.

Features

  • Contains an implementation of the general BBP formula.
  • Compute arbitrary hexadecimal digits of π out to the 100 millionth digit.
  • Compute arbitrary binary digits of log(2).

References

I was inspired to do this project by reading the short story "The Center of the Universe" in the book Reality Conditions by Alex Kasman. Before that, I first learned about the BBP formula in the "What is the Quadrillionth Decimal Place of π?" chapter of The Computer as Crucible by Jonathan Borwein and Keith Devlin. (That (obviously) is also where I stole the title of my project from.)

Documentation

The links below are relative to the installation directory. (Not the GitHub project page.)

The user's manual is here.

The design documentation is here.

About

Implementation of a Method of Bailey, Borwein, and Plouffe

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published