Skip to content
Reference > Methods

randSec(range)

Definition

Number randSec(Number range)

Description

Returns a random number between 0.0 (inclusive) and the supplied range (exculsive), if range is negative the returned value will also be <=0, note: this random is secure.

Parameter Definition

Name Type Description
range Number

Examples

1
2
3
Integer r1 = randSec(2); // r1 == 1
Double r2 = randSec(12.2D); // r2 == 6.22716025333471
Integer r3 = randSec(-19); // r3 == -4