Re: [AD] Pending patches request

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Mon, 2003-05-26 at 17:56, Angelo Mottola wrote:
> 
> The problem is the OSX libc rand() implementation places the most random
> bits in the higher word, while the lower word always gets values that repeat
> somewhat often. On Intel machines it seems to be the contrary.
> So (rand()+(rand()>>16)) should solve the issue...

No, same on intel. I.e., the lower bits aren't random with rand(). I
don't know where in the test program rand is used, but i usually do
(rand()>>8). Or if 15/16bit are needed, this has to be
(rand()>>8)+(rand()&0xff00) for windows.

Maybe it's time to add the "al_rand(int min, int max)" function to
Allegro?

-- 
Elias Pschernig <elias@xxxxxxxxxx>





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/