Functions to convert numbers between fixed and floating point representation as experienced by simulink users. Permits conversion of 8, 16 and 32 bit representation of signed and unsigned decimal numbers, with or without binary point.
INSTALLATION
Package can be downloaded from the public git repo as:
$ git clone $ python setup.py install
or installed automatically via pypi:
$ pip install fixreal
USAGE
>>> import fixreal
>>> fixreal.real2fix(-0.9921875, fixreal.get_conv(8, 7, True))
129.0
>>> fixreal.real2fix(-3.96875, fixreal.get_conv(8, 5, True))
129.0
>>> fixreal.real2fix(-127, fixreal.get_conv(8, 0, True))
129.0
>>> fixreal.real2fix(1.0078125, fixreal.get_conv(8, 7, False))
129.0
>>> fixreal.real2fix(4.03125, fixreal.get_conv(8, 5, False))
129.0
>>> fixreal.real2fix(129, fixreal.get_conv(8, 0, False))
129.0
>>> fixreal.fix2real(0b10000001, fixreal.get_conv(8, 7, True))
-0.9921875
>>> fixreal.fix2real(0b10000001, fixreal.get_conv(8, 5, True))
-3.96875
>>> fixreal.fix2real(0b10000001, fixreal.get_conv(8, 0, True))
-127.0
>>> fixreal.fix2real(0b10000001, fixreal.get_conv(8, 7, False))
1.0078125
>>> fixreal.fix2real(0b10000001, fixreal.get_conv(8, 5, False))
4.03125
>>> fixreal.fix2real(0b10000001, fixreal.get_conv(8, 0, False))
129.0
>>> conv = fixreal.conv_from_name("fix_8_7")
Metadata
Release files for fixreal 0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| fixreal-0.8.tar.gz | 59.0 kB | Without provenance | Details |
Release files / fixreal-0.8.tar.gz
| Download URL | fixreal-0.8.tar.gz |
|---|---|
| Size | 59.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3fc55c1fd7900e99a23dc83fbc05a71b33889d403ff11e5d526c309d729cb41e
|
|
BLAKE2b-256 checksum How to use checksums |
b0b0c434e7960e5dc8fb658fb9f2ff2c552e7f29d3d62957e5a8ebf159046f3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for fixreal 0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.