Skip to content

apytypes/apytypes

Repository files navigation

APyTypes

PyPI pre-commit.ci status License Workflow Status codecov DOI

APyTypes is a Python library providing algorithmic scalar and array data types, both fixed- and floating-point in Python. The main purpose is to simplify finite word length design and simulation. Written in C++, the focus is on performance and flexibility.

Documentation

https://apytypes.github.io/apytypes/

Installation

APyTypes is available in the Python Package Index and can be installed with the pip package installer:

pip install apytypes

Running

The package can now be used as:

$ python
>>> import apytypes as apy
>>> fx_a = apy.fx(3.5, int_bits=4, frac_bits=4)
>>> print(fx_a)
3.5
>>> fx_a
APyFixed(56, bits=8, int_bits=4)
>>> fx_b = apy.fx(1.25, int_bits=3, frac_bits=6)
>>> fx_a + fx_b
APyFixed(304, bits=11, int_bits=5)
>>> print(fx_a + fx_b)
4.75

Tests

Test dependencies can be installed by running pip install [.test] and then executed by pytest.

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy