Re: Random doubles

2015-01-20 Thread Alexandre Ratchov
On Tue, Jan 20, 2015 at 11:17:44AM +, Michael Savage wrote: > Hi, > > I'm having trouble generating uniform random doubles in [0,1) with > arc4random. In games, the snippet: > > (double) arc4random() / (UINT32_MAX + 1.0) > > crops up multiple times, but

Re: Random doubles

2015-01-20 Thread Theo de Raadt
> I'm having trouble generating uniform random doubles in [0,1) with > arc4random. In games, the snippet: > > (double) arc4random() / (UINT32_MAX + 1.0) > > crops up multiple times, but that isn't utilising the full precision of > a double. If you do the

Random doubles

2015-01-20 Thread Michael Savage
Hi, I'm having trouble generating uniform random doubles in [0,1) with arc4random. In games, the snippet: (double) arc4random() / (UINT32_MAX + 1.0) crops up multiple times, but that isn't utilising the full precision of a double. If you do the equivalent with a 64bit rand