int16_t decode(uint8_t t) { int16_t exp = 0x8 - (0x7 & (t >> 4)); uint16_t base = (0x1 << (exp+ 5)) - 34; int16_t step = 0x1 << exp; int16_t ret = base - step * (0xf & t); ret = -ret - 1 + (2 * ret + 1) * (t >> 7); return ret; }