Handling of minifloats (f8) as used by ICA

Code author: Martin Wieser

Module: irfpy.ica.floats

Functions to convert between f8 minifloats and integers. ICA minifloats are 8 bit in size and have the following structure:

s: sign bits e: exponent bits m: mantissa bits

s.e.m excess integer range covered 0.4.4 -4(?) 0 to 507904


Convert an 24 bit integer to a f8 minifloat. In case of overflow 0xFF is returned


Convert a f8 minifloat to 16-bit integer. In case of overflow 0xFFFF is returned


Convert a f8 minifloat to 24-bit integer. no overflow possible