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?
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
I believe the max of this function is 32767, in case that is what's bothering you with the results.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
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\"
InstallAware Software Corporation
Software Design Team Lead
\"In order to succeed, your desire for success should be greater than your fear of failure\"
InstallAware Software Corporation
-
- Posts: 25
- Joined: Tue May 23, 2006 2:22 pm
-
- 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
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
-
- Posts: 25
- Joined: Tue May 23, 2006 2:22 pm
Who is online
Users browsing this forum: No registered users and 216 guests