Signed number grief.

stimmer:
Another approach is to add 512 to the number, then AND with 1023. This converts the number to an unsigned value in the range 0 - 1023. Then convert that to a float, and subtract 512.0 to get back to a signed value.

float f = float((x+512)&1023) - 512.0 ;

Well...that's an extra floating point subtract when the exact same thing will work with integers:

float f = int((x+512)&1023) - int(512);