irfpy.ica.floats

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

irfpy.ica.floats.u24_f8(u24)[source]

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

irfpy.ica.floats.f8_u16(f8)[source]

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

irfpy.ica.floats.f8_u24(f8)[source]

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