Calculate digits of Pi in hexadecimal.

Josh Bicking 150d9e162a Disable output buffering, add arg to enable it. 7 ani în urmă
app 512e4a2339 Separate into files, consolidate calling to avoid passing. 7 ani în urmă
src 150d9e162a Disable output buffering, add arg to enable it. 7 ani în urmă
test 568982b92d Add initial revision, README and TODO list 7 ani în urmă
.gitignore 1bb650927c Initial commit 7 ani în urmă
LICENSE 1bb650927c Initial commit 7 ani în urmă
README.md 150d9e162a Disable output buffering, add arg to enable it. 7 ani în urmă
Setup.hs 568982b92d Add initial revision, README and TODO list 7 ani în urmă
pi-digits.cabal 512e4a2339 Separate into files, consolidate calling to avoid passing. 7 ani în urmă
stack.yaml eface5f694 Use argparse-applicative. Add instant evaluation & delimiter args. 7 ani în urmă

README.md

pi-digits

Calculate requested digits of Pi.

Built using The BBP Algorithm for Pi.

Building

Install stack, then run stack build from inside the repository.

Running

Run stack exec pi-digits-exe, or execute the binary found in ./.stack-work/install/.

TODO

  • [X] Add a function for converting results to decimal (and binary).
  • [X] Implement threading.
  • [X] Implement optparse-applicative for more formal/extensive arg parsing.
  • [X] Replace the mess in prompt with a monad. Issue corrected by using optparse-applicative.
  • [X] Separate into different files. Possibly parsing and logic files.
  • [X] Find a better way to transfer "globals", like delim and printFun. parseIndex handles all parsing and calling logic now.
  • [X] Implement a faster mod operation, to allow for larger numbers (like 12345678901234567890). It will likely be implemented with the algorithm explained in the paper. Used a slightly faster, less iterative way, implemented with this gist.
  • [X] Customize print behavior and frequency. Flush output every N digits, or something similar. Output is flushed as it's written. This can be disabled with --buffer.