Skip to main content

Arbitrary-precision fixed-point library for Python

Project description

pyfixed

Latest Release

pyfixed is an arbitrary-precision fixed-point arithmetics library for Python.
It currently is in early development.

pyfixed is licensed under the MIT License.

Rational

pyfixed aims to aid in simulation of fixed-point arithmetics and testing of software and hardware solutions.
It supports multiple configurations, with the goal of supporting a wide variety of hardware implementations.

pyfixed is currently not optimized, and has poor real-time performance.
While optimizations are planned in general, the project does not aim to achieve any performance goals.

Installation

Install latest:

pip3 install pyfixed

Build from source:

python -m build
pip3 install dist/*.whl

You can also use it directly by adding the root directory to your PYTHONPATH.

Features

  • pyfixed.Fixed: arbitrary-precision fixed-point.
    • Native API.
    • Simple arithmetic and bitwise operations.
    • 10 rounding modes (see pyfixed.Fixed.FixedRounding).
    • Optional exceptions on overflow, underflow and invalid operations (e.g. divide by 0).
      • Sticky exception flags.
    • Support for Python, NumPy and mpmath numeric types (integers and floats).
  • pyfixed.Complex: arbitrary-precision complex fixed-point.
  • fixed_cmp: visual comparison between fixed-point, IEEE-754 and posits.

Planned Features

  • Posit support (against softposit).
  • More functions:
    • $e^z$, $ln(z)$ and their derivatives.
    • FFT.
    • Matrix operations.
    • Other DSP-related operations.

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

pyfixed-0.3.0.tar.gz (61.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyfixed-0.3.0-py3-none-any.whl (41.5 kB view details)

Uploaded Python 3

File details

Details for the file pyfixed-0.3.0.tar.gz.

File metadata

  • Download URL: pyfixed-0.3.0.tar.gz
  • Upload date:
  • Size: 61.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.6

File hashes

Hashes for pyfixed-0.3.0.tar.gz
Algorithm Hash digest
SHA256 377a5a8791e77ec14a7bbaa79873745e46a21736e593ceeca96a2ddbbba76cd1
MD5 99bef0fa26aa8b056bdff2a86ef331c9
BLAKE2b-256 35fb8f7f1c98ff2a491eb69a8392b5c5ca3d523668b429f1bf30b7b60a2c56a7

See more details on using hashes here.

File details

Details for the file pyfixed-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pyfixed-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 41.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.6

File hashes

Hashes for pyfixed-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a921de1a2b514826d9ea82071aa823403ad04e4be1220e9af25506bb40d825db
MD5 2db6c5f25fdbf440f4d99a67f3b0dd8c
BLAKE2b-256 7e75417c3e6f78083c08ac6971d5efe0bf5e162178556f045e9a0f334be35ec8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page