summaryrefslogtreecommitdiff
path: root/src/scripts/fix.5c
blob: b758a433f430d0395757c4786daaecc74a84f3e2 (plain)
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;
}