#ifndef __BIT_UTILS_H__ #define __BIT_UTILS_H__ /** * f2i - Convert a float to an integer with the same bit pattern. */ int f2i (float f); /** * i2f - Convert an integer to a float with the same bit pattern. */ float i2f (int i); /** * ith_bit (n,i) - Get the ith bit of n. * Pre: 0 <= i < 32 */ int ith_bit (int n, int i); /** * zero_bit (n,i) - Zero the ith bit of n, returning the result. * Pre: 0 <= i < 32 */ int zero_bit (int n, int i); #endif // __BIT_UTILS_H__