Objective-C Math Random Number

April 28, 2009 § 3 Comments

int i = arc4random() % 100;

i will generate an integer between 0 and 100. % is reminder.

§ 3 Responses to Objective-C Math Random Number

  • That’s an interesting article. I just wondered if you could tell me where to find more info on this topic ?

  • Debbie says:

    > int i = arc4random() % 100;
    > generate an integer between 0 and 100.

    *BETWEEN* 0 and 100? (Meaning 1-99)
    False.

    It will include 0… and it will include 99… and all the numbers in between.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading Objective-C Math Random Number at Web Builders.

meta

%d bloggers like this: