cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
rand()
rand()
Sep 19, 2010 at 3:56pm UTC
Gunni
(1)
Is there any way to make rand() generate numbers that are bigger than 32768. Or maybe another function that does that?
Sep 19, 2010 at 4:26pm UTC
m4ster r0shi
(2201)
Sure, take a look at this ->
http://www.cplusplus.com/forum/lounge/23263/page7.html#msg126360
I use a custom random number generator that gives 'random' numbers from 0 to 31 and I extend its range without modifying the generator itself. You can apply the same logic to extend std::rand's range.
Topic archived. No new replies allowed.