▲ | taneq 5 days ago | ||||||||||||||||
Division is slow, though. You should use something like: right_shifted = (int)(value * pow(2, -bits) - 0.5) | |||||||||||||||||
▲ | jandrewrogers 5 days ago | parent | next [-] | ||||||||||||||||
Or just rely on the compiler to automatically do trivial conversions. Which are pretty reliable these days. | |||||||||||||||||
| |||||||||||||||||
▲ | voxelghost 5 days ago | parent | prev [-] | ||||||||||||||||
I dont trust my intel FPU to accurately representa that ;-) |