#include <cstdio>
// create a compressed float
// NOTE: in g++, references to this with constants are
// automatically converted to constants, so this
// call takes no time to execute.
static inline float cf(float f) {
union { float f; unsigned int i; } v;
v.f = f;
v.i &= 0xFFFF0000;
//this operation can be more complex if necessary to improve quality
//as long as it's constant, it shouldn't increase the size of the
//executable.
return v.f;
}
int main(int argc, char **argv) {
printf("%f\n", cf(0.04f));
return 0;
}