
26 Nov
2013
26 Nov
'13
12:33 a.m.
On Mon, Nov 25, 2013 at 2:53 PM, Steven Watanabe
AMDG
On 11/25/2013 02:22 PM, Brian Budge wrote:
You can achieve what you want by generating a random number on [-1, 1] and multiplying it by the max float. I don't think that there is a *general* way to arrive at a uniform distribution of a range greater than max float by first generating a random number on [0, 1), so it's unlikely that the library can be "fixed" to achieve what you want.
It's really quite easy.
if ( max - min == infinity ) { divisor = 2; min /= divisor; max /= divisor; } else { divisor = 1; }
Ah, I see. Nice :) Thanks for suggesting another simple solution. Brian