• 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 14:52:33 +1000

On 27/05/2011, at 2:42 PM, Clark Cox wrote:

> No. 'unsigned' is the same size on both 32- and 64-bit The only
> built-in types that are different between 32- and 64-bits are:
>
> signed long
> long (which is really the same as "signed long")
> unsigned long
> and any pointer type
>
> All other built-in types remain the same size between the two.


Thankyou - a definitive answer. I will print it out and frame it :)

This suggest that Conrad's analysis is not quite right then, since even if I'm overflowing the 32-bit integer, there's still enough variation in what remains to give a valid and usable seed:

2011-05-27 14:25:14.689 Squaresgame[83159:a0f] seed: 276132753
2011-05-27 14:25:14.691 Squaresgame[83159:a0f] random: 1826068185
2011-05-27 14:49:36.081 Squaresgame[83217:a0f] seed: 290746671
2011-05-27 14:49:36.083 Squaresgame[83217:a0f] random: 162579918


--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

  • Follow-Ups:
    • Re: Seeding random() randomly
      • From: Conrad Shultz <email@hidden>
References: 
 >Seeding random() randomly (From: Graham Cox <email@hidden>)
 >Re: Seeding random() randomly (From: Conrad Shultz <email@hidden>)
 >Re: Seeding random() randomly (From: Graham Cox <email@hidden>)
 >Re: Seeding random() randomly (From: Clark Cox <email@hidden>)

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