Re: Random numbers?
Re: Random numbers?
- Subject: Re: Random numbers?
- From: Sherm Pendley <email@hidden>
- Date: Wed, 4 Jul 2007 16:39:28 -0400
On Jul 4, 2007, at 11:52 AM, Matt Neuburg wrote:
On Wed, 4 Jul 2007 09:43:41 -0500, William Squires
<email@hidden>
said:
What's the proper way to get a random number in ObjC/Cocoa? I need it
in an NSNumber to put in an NSArray. Thanks.
I don't know about "proper", but man random. This will at least
give you
some ideas.
If you need more detailed control over the generator and distribution
functions than the standard C functions give you, you might check out
the Random module in Boost. Not too many folks need that level of
control, but if you do, check it out:
<http://www.boost.org>
It's a C++ library, but you could call it with not much trouble using
Objective-C++. It's fairly future-proof too, since it's included in
TR1 - a technical report from the C++ standards committee concerning
what will eventually be the next C++ standard.
sherm--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
_______________________________________________
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