I have at my disposal a 32-bit unsigned int produced by a uniform random number generator routine. I would like to convert this number to a float in the range [0,1]. Obviously this is most easily done by dividing the unsigned int by UINT_MAX, casting both to float before division. Unless I m very mistaken, I think such a division will cost me a lot of precision and is therefore not ideal.
Since this action will be performed in openCL, I assume not to have double variables I could use intermediately.
Any ideas how I could generate the float in a better way?
Thanks in advance!
Tom