May 22, 2003 #1 RussOSU Technical User Apr 16, 2001 93 US I am needing to create a random number between -3 and +3. I am not sure how to do this using the rand() function. Does anyone have any ideas? Russ
I am needing to create a random number between -3 and +3. I am not sure how to do this using the rand() function. Does anyone have any ideas? Russ
May 23, 2003 #2 JasonDeckard Programmer Mar 20, 2003 136 US How about generated a random number between zero and six, then subtracting 3? result = (rand() % 7) - 3; Upvote 0 Downvote
How about generated a random number between zero and six, then subtracting 3? result = (rand() % 7) - 3;