Comparison

Comparison matrix

Fixed-point libraries

Library

APyTypes

fixedpoint

fpbinary

fxpmath

numfi

pyfixp

spfpm

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

Floating-point libraries

Library

APyTypes

gmpy2

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

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.

Benchmark numbers for different fixed-point libraries. Benchmark relative to APyTypes for different fixed-point libraries.