Re: Glib rand() revisited: RAND_MAX?



> >         Should g_rand_int() (in CVS) have an equivalent of RAND_MAX
> > #defined?  (it would just be the highest number a guint32 can hold)

> As everybody knows the highest number a guint32 can hold is 2^32-1 I dont
> think, we should have yet another constant for that. Other opinions?

	It's not so much that we don't know what 2^32-1 is, as much as
consistency with the standard C library "rand()" function.

	On many platforms RAND_MAX is simply equal to 2^32-1 anyway--it's
just a matter of being more like existing conventions.


--Derek




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