Re: Glib rand() revisited: RAND_MAX?
- From: Derek Simkowiak <dereks kd-dev com>
- To: Sebastian Wilhelmi <wilhelmi ira uka de>
- cc: gtk-devel-list redhat com, recipient list not shown: ;
- Subject: Re: Glib rand() revisited: RAND_MAX?
- Date: Tue, 22 Feb 2000 11:14:26 -0800 (PST)
> > 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]