• 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: Seeding random() randomly
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Seeding random() randomly


  • Subject: Re: Seeding random() randomly
  • From: Graham Cox <email@hidden>
  • Date: Fri, 27 May 2011 12:06:48 +1000

On 27/05/2011, at 11:53 AM, Ken Thomases wrote:

> %u
>
>> I'm confused about how to correctly write format specifiers for both 32 and 64-bit runtimes. The 64-bit porting guide doesn't spell it out (yet you end up with code peppered with warnings that you should examine the use of the format specifier without docs properly explaining their correct use). It's also not clear to me whether just 'unsigned' is a fixed-size quantity or not, depending on architecture.
>
> Just "unsigned" is shorthand for "unsigned int".  Between the Mac's 32-bit and 64-bit architectures, int doesn't change size.  That can't be generalized, although it's darn-near universal.
>
> However, that's irrelevant.  The format specifiers don't indicate a size.  They indicate a type.  For "unsigned", you use "%u".  That's the end of the story.


Thanks Ken, very helpful.

I just looked again at the 'string format specifiers' page in the docs. Seems it's been much fleshed out since I last looked, and sure enough it's now much clearer what to use when.

--Graham

_______________________________________________

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: 
 >Seeding random() randomly (From: Graham Cox <email@hidden>)
 >Re: Seeding random() randomly (From: Quincey Morris <email@hidden>)
 >Re: Seeding random() randomly (From: Graham Cox <email@hidden>)
 >Re: Seeding random() randomly (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: Seeding random() randomly
  • Next by Date: Re: Seeding random() randomly
  • Previous by thread: Re: Seeding random() randomly
  • Next by thread: Re: Seeding random() randomly
  • Index(es):
    • Date
    • Thread