to compute N digits of pi
Project description
this is toy tool to compute the N digits of pi
usage
python usage
- python3 setup build
- python3 pi.py 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.15.tar.gz
(10.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pi_compute-3.14.15.tar.gz.
File metadata
- Download URL: pi_compute-3.14.15.tar.gz
- Upload date:
- Size: 10.5 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 |
5092b4222c2c0c3e1b06730fe90cf663bbe24cf5b7b3ee569f4b9619da950ec8
|
|
| MD5 |
9d182c2366e4f0ceb5fae80f9cc91f35
|
|
| BLAKE2b-256 |
16e3b37fed509327d11ff0e4ed6241f69918a5c74ae747b1ac4199eb5feeef2a
|
File details
Details for the file pi_compute-3.14.15-py3-none-any.whl.
File metadata
- Download URL: pi_compute-3.14.15-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- 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 |
732920784bb5de21631a364841d3d46bb75224ccca3612fc3d25a710559b8d51
|
|
| MD5 |
4f62e0e96bd64d5c0f925bd05d5cef8b
|
|
| BLAKE2b-256 |
d6b43eb14a6aa45dad110f34474eb3d047e8a7661e8e8119a812a6f87237c545
|