• 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: repeatable random numbers in an object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: repeatable random numbers in an object


  • Subject: Re: repeatable random numbers in an object
  • From: Michael Ash <email@hidden>
  • Date: Wed, 17 Jun 2009 15:16:18 -0400

On Wed, Jun 17, 2009 at 1:05 PM, Kyle Sluder<email@hidden> wrote:
> On Wed, Jun 17, 2009 at 9:54 AM, Kirk Kerekes<email@hidden> wrote:
>> <http://www-cs-faculty.stanford.edu/~knuth/programs/rng.c>
>
> Not to knock on Don Knuth, but I wouldn't recommend using that code in
> your app.  There's a perfectly good RNG facility in the system as Mr.
> George Warner pointed out, and Knuth's code is designed for a 32-bit
> system.  While it will work on OS X (because we use LP64), it will be
> wrong on Win64 (which uses ILP64) and will cause problems if you
> upcast to NSUInteger on OS X.

Nitpick: Windows is actually LLP64 (int and long are 32, long long and
pointers are 64) and so it will work fine there.

This is not to detract from your overall point in any way. If your
code needs precise sizes, use a data type which specifies the size
explicitly, like the standard int32_t and friends in stdint.h.

Mike
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: repeatable random numbers in an object (From: Kirk Kerekes <email@hidden>)
 >Re: repeatable random numbers in an object (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Group CGAffineTransform Animations?
  • Next by Date: Re: Group CGAffineTransform Animations?
  • Previous by thread: Re: repeatable random numbers in an object
  • Next by thread: MDSchemaCopyAllAttributes() returning nil
  • Index(es):
    • Date
    • Thread