Re: Seeding random() randomly
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