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 == 0
Double r2 = randSec(12.2D); // r2 == 5.476482206289691
Integer r3 = randSec(-19); // r3 == -16