Simplify radicals.
Project description
simprad
Simplify radicals.
Simplifies a radical into a multiple of the square root of a prime number. Based on the popular SIMPRAD for TI-BASIC of unknown author. Supports negative numbers and arbitrary roots.
When the input is a nonnegative number, the output will be a Tuple of two
real numbersߞthe coefficient and the radicand.
When the input is a negative number, the output will be a Tuple of a complex
coefficient and a real radicand.
Use simprad as a module:
from simprad import simprad
print(simprad(50)) # (5, 2)
print(simprad(36)) # (6, 1)
print(simprad(-50)) # (5j, 2)
print(simprad(8, 3)) # (2, 1)
Use simprad as a command line utility:
$ python -m simprad Radical to simplify: √50 Root [2]: 2 5 × √2
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
simprad-1.0.7.tar.gz
(2.4 kB
view details)
Built Distribution
File details
Details for the file simprad-1.0.7.tar.gz
.
File metadata
- Download URL: simprad-1.0.7.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
2154e5d6c561cf28d0b622b19b730ac44e18ee27527b8084f63ded7f704fd9c6
|
|
MD5 |
893f3bc204421de9a7c8758577957be3
|
|
BLAKE2b-256 |
29cd0197843f91bdeb1bb016b4432a2dfb13452939c9e7752874aa490cf560be
|
File details
Details for the file simprad-1.0.7-py3-none-any.whl
.
File metadata
- Download URL: simprad-1.0.7-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
0a970a4bd279c0e8f932cc3d72004918cf38c0f7ad05950ea0182714cb43cbe5
|
|
MD5 |
13a20a922299dc1fceae1bc8758281af
|
|
BLAKE2b-256 |
3b4b8d34b40a27bfbdc7303570dd7974340636b46744790722ac045fc41d0c84
|