• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: rand() and srand() broken?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rand() and srand() broken?


  • Subject: Re: rand() and srand() broken?
  • From: Derek Gaston <email@hidden>
  • Date: Wed, 25 Nov 2009 11:57:01 -0700

On Nov 25, 2009, at 11:45 AM, Jens Alfke wrote:

You shouldn't be using rand; it's not a good PRNG and it was obsoleted ages ago by random().
Even the man page tells you not to use it:

Understood... but in an application like mine where I need to query a random number millions of times... random() is much too slow.


I think the answer is just to take a few numbers of rand() to get the number I'm looking for.... which is still quite a bit faster than using random().

Thanks for the reply!

Derek
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >rand() and srand() broken? (From: Derek Gaston <email@hidden>)
 >Re: rand() and srand() broken? (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: rand() and srand() broken?
  • Next by Date: Re: [APPL:DarwinDev] Re: rand() and srand() broken?
  • Previous by thread: Re: rand() and srand() broken?
  • Next by thread: Re: [APPL:DarwinDev] Re: rand() and srand() broken?
  • Index(es):
    • Date
    • Thread