I want three random numbers from my script in the range 0 to 50000 that are different each time the script is run on the same PC.
I am generating the number as follows:
RANDOM1 = Generate Random Number (max value 50000)
RANDOM2 = Generate Random Number (max value 50000)
RANDOM3 = Generate Random Number (max value 50000)
These are sample results:
RANDOM1 = 2400
RANDOM2 = 700
RANDOM3 = 1300
RANDOM1 = 4300
RANDOM2 = 2700
RANDOM3 = 4700
RANDOM1 = 1400
RANDOM2 = 2900
RANDOM3 = 3500
Clearly I've got something wrong, but what?
How to make random numbers?
-
MichaelNesmith
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
Yes, the MAX_INT value on Windows is 32767..If you want more, you have to multiply it, or create a custom dll and get the result from there!
Panagiotis Kefalidis
Software Design Team Lead
\"In order to succeed, your desire for success should be greater than your fear of failure\"
Install[b]Aware[/b] Software Corporation
Software Design Team Lead
\"In order to succeed, your desire for success should be greater than your fear of failure\"
Install[b]Aware[/b] Software Corporation
-
Mark Fulford
- Posts: 25
- Joined: Tue May 23, 2006 2:22 pm
-
MichaelNesmith
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
They seed the random number generator with the specified number. Each seed must be unique for the random number generation to be truly pseudo-random. Please see the Serial Validation example project for detailed real-world usage of these functions.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
-
Mark Fulford
- Posts: 25
- Joined: Tue May 23, 2006 2:22 pm

