michaelsoftman Posted January 8, 2013 Group: Members Topic Count: 48 Topics Per Day: 0.01 Content Count: 410 Reputation: 29 Joined: 04/04/12 Last Seen: November 28, 2024 Share Posted January 8, 2013 Does rnd() generate a number between 0 and x or 1 and x? In other words, would rnd()%18 generate a random number between 0 and 18 or 1 and 18? Quote Link to comment Share on other sites More sharing options...
clydelion Posted January 8, 2013 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 754 Reputation: 186 Joined: 05/22/12 Last Seen: October 15, 2022 Share Posted January 8, 2013 between 0 and x-1. in your example: 0~17 Quote Link to comment Share on other sites More sharing options...
Lighta Posted January 8, 2013 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 737 Reputation: 216 Joined: 11/29/11 Last Seen: December 20, 2020 Share Posted January 8, 2013 That 2 question, you can't really said in other word. rnd() : /// Generates a random number in the interval [0, SINT32_MAX] % : modulo sign, return the rest of division => y%x = [0;x-1] Quote Link to comment Share on other sites More sharing options...
Question
michaelsoftman
Does rnd() generate a number between 0 and x or 1 and x?
In other words, would rnd()%18 generate a random number between 0 and 18 or 1 and 18?
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.