GithubHelp home page GithubHelp logo

c0ndu17 / quadrillionth-decimal-place Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paul-reiners/quadrillionth-decimal-place

0.0 2.0 0.0 415 KB

Implementation of a Method of Bailey, Borwein, and Plouffe

Makefile 4.46% C 95.54%

quadrillionth-decimal-place's Introduction

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.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.