Code functions that pack and unpack a range of a float into a limited number of bits.
unsigned int pack_float(float val, float minVal, float maxVal, int bits);
float unpack_float(unsigned int val, float minVal, float maxVal, int bits);
#include#include using namespace std;// Code functions to pack and unpack a range of a float into a limited // number of bits:unsigned int pack_float (float val, float minVal, float maxVal, int bits);float unpack_float(unsigned int val, float minVal, float maxVal, int bits);unsigned int pack_float(float val, float minVal, float maxVal, int bits){ assert(bits < 32); assert(val >= minVal && val < maxVal); return (unsigned int)(1U<