Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Random Numbers

Status
Not open for further replies.

Butters261285

Programmer
Jan 2, 2006
29
GB
Here are some useful Lingo codes for generating different types of random numbers:


Any random number

random(x) (replace x with a number to show the maximum amount)

Between 0 and 10

random(11) - 1

Between 50 and 100

random(51) + 49

Decimals between 0 and 1

(random(101) - 1)/100.0

To generate floating point numbers and add a random interger

random(x) + (random(101) - 1)/100.0 (replace x with a number)

Hope these come in useful to people ^_^
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top