Comparison¶
Comparison matrix¶
Library |
APyTypes |
||||||
---|---|---|---|---|---|---|---|
Custom fixed-point formats |
Yes |
Yes |
Yes |
Yes |
Yes [1] |
Yes |
Yes |
Custom floating-point formats |
Yes |
No |
No |
No |
No |
No |
No |
Maximum wordlength [4] |
None |
None |
None |
None |
64 [1] |
53 [2] |
None |
Resizing of fixed-point results |
Yes |
Yes |
Yes |
Yes |
Yes [1] |
Yes [2] |
No |
Arrays |
Yes |
No |
No [3] |
Yes |
Yes |
Yes [2] |
No |
Matrix multiplication ( |
Yes |
N/A |
N/A |
No |
No |
Yes [2] |
N/A |
Written in |
C++/Python |
Python |
C/Python |
Python |
Python |
Python [2] |
Python |
Footnotes
Library |
APyTypes |
|
---|---|---|
Custom fixed-point formats |
Yes |
No |
Custom floating-point formats |
Yes |
Yes |
Binary representation of number [5] |
Yes |
No |
Maximum wordlength |
32 bits for exponent, 64 bits for mantissa [6] |
None |
Stochastic rounding |
Yes |
No |
Arrays |
Yes |
No |
Matrix multiplication ( |
Yes |
N/A |
Written in |
C++/Python |
C/Python |
Footnotes
This means that it is possible to get a binary representation for comparison with, e.g., a hardware implementation.
This is a design choice since apytypes
is aimed at simulating shorter custom formats. However, there are unlimited word length support for fixed-point values which can be used for floating-point as well.
Performance Comparison¶
This benchmark compares relevant fixed-point libraries from the list above. It is updated every documentation build and may vary over time as the code is further optimized.

