Metadata-Version: 2.1
Name: pi-compute
Version: 3.14.159
Summary: to compute N digits of pi
Home-page: https://github.com/tlming16/pi
Author: mathm
Author-email: tlming16@fudan.edu.cn
License: UNKNOWN
Project-URL: Bug Tracker, https://github.com/tlming16/pi-/issues
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# this is toy tool to compute the N digits of pi

## usage

### install 
   - `python3 -m pip install pi-compute==3.14.15` or 
   - `python3 -m pip install  --index-url https://pypi.org/simple/ pi-compute==3.14.15`


### python usage

-   `python3 -m pi_compute.pi 1000`
-   `import pi_compute as pi; pi.compute(1000)` 

### cpp usage
-   `make pi_thread` for two threads
-   `make pi_v2` for single thread

## implementations

-   pi.d:this is the original d language implementations of pi
-   pi.cpp: motivated by pi.d and use two threads to build the dynamic shared library
-   `test/pi_v2.cpp` is single thread
-   `test/pi_thread.cpp` is two threads

## reference:

-   <https://github.com/dlang/dmd/blob/master/samples/pi.d>

-   <https://en.wikipedia.org/wiki/Pi>

-   v1: $$\arctan(\frac{1}{2}) +\arctan(\frac{1}{3}) =\frac{\pi}{4}$$

-   v2: $$4\arctan(\frac{1}{5}) - \arctan(\frac{1}{239}) =\frac{\pi}{4}$$


