2 ms·
> I'm not really familiar with the larger issue, but the scaling method is easy as long as you have an easy way of producing a uniformly distributed random valu
by Dylan16807 4y ago
> I'm not really familiar with the larger issue, but the scaling method is easy as long as you have an easy way of producing a uniformly distributed random value between 0 and 1. That's not so easy to do
It's plenty easy to do. Start with 1.0 then fill the mantissa with random bits. For a flat distribution subtract 1.0. For an "every float is possible" distribution count the leading 0 bits in another chunk of random, and subtract count+1 from the exponent.
You'd probably want the former for a situation like this.