2 softfloat and softposit in Python
3 * support for softfloat float16, float32, and float64
4 * support for softposit posit8, quire8, posit16, quire16, posit32, and quire32
7 On most linux distros with CPython 2.7, 3.4, 3.5, 3.6, or 3.7, sfpy should work out of the box:
13 Under the hood, sfpy uses Cython to create bindings for the softposit and softfloat C libraries.
14 The building instructions are tested on Ubuntu 16.04 - for other platforms they may need some
20 >>> from sfpy import *
21 >>> a, b = Float16(1.3), Float16(1.4)
23 Float16(0.89208984375)
24 >>> sfpy.float.flag_get_inexact()
30 >>> x, y = Posit16(3.0), Posit16(3)
36 Posit16(2.9802322387695312e-08)
40 Posit16(8.940696716308594e-08)
42 >>> for i in range(10000):
43 ... acc = acc.fma(x, y)
46 Posit16(1.9073486328125e-06)
50 >>> for i in range(10000):
54 Quire16(0.00089263916015625)
58 Posit16(0.00089263916015625)
64 See [BUILDING](https://github.com/billzorn/sfpy/blob/master/BUILDING.md).