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-compute==3.14.15orpython3 -m pip install --index-url https://pypi.org/simple/ pi-compute==3.14.15
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.159.tar.gz
(10.7 kB
view details)
File details
Details for the file pi_compute-3.14.159.tar.gz.
File metadata
- Download URL: pi_compute-3.14.159.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.61.2 importlib-metadata/4.6.4 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9900483d2482344a1ac48418236ce2eada3543fa76955a1b0ac92af81c89b33
|
|
| MD5 |
3cc7ef3fd1ed9e9744d2fb838d761d94
|
|
| BLAKE2b-256 |
c549184dd4cfebd581dbd1082187d0818704f8a7530192c34de5c3da8d516a25
|