Generates a random value.

Syntax

Result = SRP_Math("RANDOM", Min, Max, DecimalPlaces, ScientificNotation)

Returns

A random number between the given Min and Max.

Remarks

The RANDOM operation generates a random number. Random numbers will not be less than Min nor more than Max. If you omit these values, then they default to 0.0 and 1.0 respectively.

You can specify RAND for short.

Example

// Generate a random decimal number between 0.0 and 1.0
RandomNumber1 = SRP_Math("RANDOM") 
// Generate a random decimal number between 0.0 and 1.0, abbreviating the operation name
RandomNumber2 = SRP_Math("RAND")
// Generate a random number between 1 and 100, rounded to the nearest integer
RandomNumber3 = SRP_Math("RANDOM", 1, 100, 0)
// Generate a random number between 100 and 100,000, truncating the decimal
RandomNumber4 = SRP_Math("INT", SRP_Math("RANDOM", 100, 100000))
  • No labels