From: Dennis S. <sy...@yo...> - 2004-10-02 10:07:27
|
On Fri, 2004-10-01 at 23:10 +0300, Vitaly V. Bursov wrote: > > which returns 1 with a propability of p (0.0 <= p <= 1.0) > :) Nice idea. > > int lv_random_decide(float a) > { > float x=(float)random()/RAND_MAX; > return x <= a; > } You guys probably figured by now that my math skills really suck :) Thanks for the translation to code heheheh. I think I'll be implementing this today, and some other randomness functions. Cheers, Dennis |