Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 

pi-generator-from-random-numbers

This program generates random numbers, and calculates Pi based off the odds that those two numbers are co-prime. This was mostly just an excuse for me to learn concurrency in Rust, which I was fairly successful with. Change the num_runs variable to increase or decrease the number of trials.

This was inspired by this video by Matt Parker.

If you like this, you might also be interested in my pi-generator-from-blocks repository, where I calculate Pi using elastic collisions.

Usage

From homebrew

You can install this from my homebrew tap by running =brew install jakevossen5/taps/pi-generator-from-random-numbers, then running pi-generator-from-random-numbers RUNS where RUNS is the number of iterations that you want.

From source

  • Clone / download this repository
  • Install rust
  • Run with cargo run RUNS where RUNS is the number of iterations you want.

About

Generates Pi from random numbers and co-primes

Resources

License

Packages

No packages published

Languages