to compute N digits of pi
Project description
this is toy tool to compute the N digits of pi
usage
install
python3 -m pip install pi-computeorpython3 -m pip install --index-url https://pypi.org/simple/ pi-compute
python usage
python3 -m pi_compute.pi 1000import pi_compute as pi; pi.compute(1000)
cpp usage
make pi_threadfor two threadsmake pi_v2for 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.cppis single threadtest/pi_thread.cppis two threads
reference:
-
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}$$
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pi_compute-3.14.15926.tar.gz
(13.9 kB
view details)
File details
Details for the file pi_compute-3.14.15926.tar.gz.
File metadata
- Download URL: pi_compute-3.14.15926.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23d8aaffc20c30fc2a835946d0619649e800ebcc9325b85c9e70f1269950718a
|
|
| MD5 |
49b9666a3f3d0542db37715f3474cebf
|
|
| BLAKE2b-256 |
0b24096c27345249d6311369ea20e888cfd97b99d2f0731b060552b93bd44cfa
|