public static float bitShave ( float value , int bitMask ) { if ( Float . isNaN ( value ) ) return value ; // ?? int bits = Float . floatToRawIntBits ( value ) ; int shave = bits & bitMask ; return Float . intBitsToFloat ( shave ) ; }
Shave n bits off the float