Skip to main content
Every scalar exposes the integer underneath it and the exact value it represents.

The bit pattern

The chip stores sign and magnitude. bits is that pattern as an unsigned integer; sign and mantissa are its two fields.
Round trips:

Format constants

sf.info(dtype) returns the constants of a width, in the spirit of numpy.finfo:

Printing

repr shows the type and the float value: sf16(0.100006103515625). The float is exact for every width (every code is a dyadic rational, which float64 represents without error), so what you see is what is stored.