Random floats probably lose a bit of randomness
Describe the bug
The code to generate random single-float and double-float values loses a bit of randomness because they smash the bits of an integer into a float and subtract that float from 1.
As mentioned in the section "Generating uniform doubles in the unit interval" from https://prng.di.unimi.it/, with this method
you will be generating half the values you could actually generate.... All doubles generated will have the lowest significand bit set to zero
They recommend right shifting the 64-bit random integer by 11 and multiplying by 2-53 (for doubles).
Since we've changed the generator in #276 (closed), perhaps this is also a good time to change how floats are generated.
Desktop (please complete the following information):
- OS: All
- Version: 21d and later