Fix regarding the linux luminance selction bug

reinterpret_cast in fast_log2 didn't work as expected (by the programmer) for linux - reimplementing it using unions