Posit arithmetic library with no frills
Project description
posit-playground
Goals:
- output nice bit representations
- build posit
from_double
andfrom_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 hashes)
Built Distribution
Close
Hashes for posit_playground-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c407dc291746fbb1de26c67b21228ff7f1cc7b475c9d430da562421337dfbfa0 |
|
MD5 | 6cf125075eeced207d2484f94cb37f7b |
|
BLAKE2b-256 | 8fa3f277aa03c42e63b71422b740ed68a751f1afef280f794d7d135d35eb1234 |