Metadata-Version: 2.1
Name: numfi
Version: 0.2.0
Summary: a numpy.ndarray subclass that does fixed-point arithmetic
Home-page: https://github.com/ZZZZzzzzac/numfi
Author: ZinGer_KyoN
Author-email: zinger.kyon@gmail.com
License: MIT
Project-URL: Bug Tracker, https://github.com/ZZZZzzzzac/numfi/issues
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: numpy

# numfi
numfi is a numpy.ndarray subclass that does fixed-point arithmetic.

Feature:
- Automatically perform fixed-point arithmetic through overloaded operators
- Maximum compatibility with numpy and other library, just like a normal numpy.ndarray
- Optimized calculation speed by minimizing quantization as much as possible 

## Install
**Prerequisite**: python3 and numpy

currently numfi is not ready for pypi, so you can clone this repo and build/install locally by:
```
python setup.py bdist_wheel

python -m pip install numfi --upgrade --force-reinstall --find-links=./dist 
```
or you can just copy [`numfi.py`](./numfi/numfi.py) and use as what you want, after all it's only 200 lines of code in one file
## Quick start
```python
from numfi import numfi

# numfi(array, signed, bits_word, bits_frac, rounding='round', overflow='wrap')
x = numfi([1,2,3],1,16,8) 

# any arithmetic operation with numfi will return a numfi object with proper precision and value
y = x + 1 
z = x * 2
w = x / (0.1 + x)
...
```
## Document
Details can be found here: [https://numfi.readthedocs.io/en/latest/?](https://numfi.readthedocs.io/en/latest/?)

## License
The project is licensed under the MIT license.

