Skip to content

oniani/chudnovsky

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chudnovsky

The Chudnovsky algorithm for calculating the digits of Pi.

Fun fact: it generated over 3 million digits in a little over 7 minutes on a regular, not very powerful machine.

Dependencies

Run

cargo build --release
./target/release/chudnovsky 150 100

The output should look like this:

Approximation: 3.1415926535897932384626433832795028841971693980
Precision:     150
Iterations:    100

The number of iterations and the precision can both be modified via providing different arguments to the binary. The first and second arguments being the precision and the number of iterations respectively.

One could also directly change PRECISION and ITERATIONS constants in src/main.rs.

The bigger both variables, the more digits will be generated.

Tests

cargo test --release

References

License

MIT License

About

The Chudnovsky algorithm for calculating the digits of Pi

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages