Posit arithmetic library with no frills
Project description
posit-playground
Goals:
- output nice bit representations
- build posit
from_doubleandfrom_bits - implement basic math operations
- add/sub
- mul
- div
Install
- stable
pip install posit-playground
Usage
from posit_playground import from_bits, from_double
p1 = from_bits(
bits=0b000110111011101,
size=16,
es=3,
)
p2 = from_double(
x=2.312,
size=6,
es=1,
)
p1 * p1 # implements posit multiplication
or better yet, launch a notebook on binder
or visit notebooks/1_posit_playground_demo.ipynb
Changelog
See CHANGELOG.md.
Demo
Screenshot of posit-playground in action, with a corner case example in which the exponent is chopped off the bit fields
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
posit-playground-0.1.3.tar.gz
(10.6 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 posit-playground-0.1.3.tar.gz.
File metadata
- Download URL: posit-playground-0.1.3.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.9.7 Darwin/19.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0657d1741af8343211f1beef809c35164429aa46a6fd31e70b8bfb7d7fe70a1
|
|
| MD5 |
be84e042885b146a00497236c98800f8
|
|
| BLAKE2b-256 |
730bc86ffc2b9dd88b68776212e591e1856d878cb4bf9194a3a5f4d92224a534
|
File details
Details for the file posit_playground-0.1.3-py3-none-any.whl.
File metadata
- Download URL: posit_playground-0.1.3-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.9.7 Darwin/19.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c407dc291746fbb1de26c67b21228ff7f1cc7b475c9d430da562421337dfbfa0
|
|
| MD5 |
6cf125075eeced207d2484f94cb37f7b
|
|
| BLAKE2b-256 |
8fa3f277aa03c42e63b71422b740ed68a751f1afef280f794d7d135d35eb1234
|