Re: Random()
Re: Random()
- Subject: Re: Random()
- From: Andres Santiago Perez-Bergquist <email@hidden>
- Date: Sun, 14 Dec 2003 00:33:35 -0600
On 13 Dec 2003, at 3:13 PM, Shaun Wexler wrote:
On Dec 13, 2003, at 12:41 PM, Joost Markerink wrote:
// how can i get a random float between 0 - 1, do i have to use C?
how?
static const float rand_norm = 1.0f / (float)RAND_MAX;
#define RANDOM_FLOAT (rand_norm * (float)rand())
In general, for new code that does not depend on previously
established sequences of pseudo-random numbers, you should use random()
instead of rand(), as it provides superior levels of randomness.
-- Andres Santiago Perez-Bergquist
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: | |
| >Random() (From: Joost Markerink <email@hidden>) |
| >Re: Random() (From: Shaun Wexler <email@hidden>) |