1 2 3 4 5 6 7 8 9 10 11 12 13 14
/* * Convert CSC fix point values to floats */ real fixval (int fix) { int exp = fix >> 9; int mant = fix & ((1 << 9) - 1); real ret; if (exp == 0x7) return 1.0; ret = (2 ** -exp) * mant / (1 << 9); return ret; }