Re: [AD] rand() vs random()

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


Eric Botcazou wrote:

> > calling it on on the system driver's init method or allegro_install()
> > should suffice, but grepping through allegro's sources i only find one
> > occurrence of rand() and that's in colblend.c, no occurrence of srand()
> > though. i beleive i have just found a bug.
> 
> This call to rand() is in a blender and we probably don't care about real 
> randomness here.

And even if we do, allegro shouldn't call the seed function, because
then programmers cannot rely on getting reproducable random series
anymore. I haven't used it myself yet, but a common method in
numerical models is to always use the same seed during debugging and
testing for reproducable results.

Hein

>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-< 
 Unix is user friendly. It's just very particular about who 
 it's friends are.

 Hein Zelle                     hein@xxxxxxxxxx
	                        http://www.icce.rug.nl/~hein
>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-<




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