Re: [PATCH] small glib fix.



On 30 May 2001 13:19:27 -0700, Darin Adler wrote:
> On Wednesday, May 30, 2001, at 02:21  PM, Anders Carlsson wrote:
> 
> > Really? I just based it on the g_rand_boolean macro:
> >
> > #define g_rand_boolean(rand) (g_rand_int ((rand)) & (1<<15))
> >
> > Is that wrong too?
> 
> I think so.

I don't think it makes much difference. If the g_rand_int() function
where truly random (i.e. each number had an equal chance of occuring,
regardless of what the last number was) then it would absolutely make no
difference (all your doing is selecting which bit to use). However I
would have thought that the least significant bit was more likely to
have a better spectral spread than the most significant bit.

This is all dragging up college math that is a bit rusty.

Damian





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]