Skip to main content

Random

Using the math standard library you can generate random numbers.

Note: The random numbers that are generated are not random enough for sensitive security tasks, such as generating encryption keys, tokens for authentication, or anything requiring unpredictable randomness for security purposes.

main.w
bring math;

log(math.random(100));

log(math.ceil(math.random(100)));

log((math.random()*5)+5);

Wing console output
# Run locally with wing console, output will vary
46.58171364582826
4
5.721934646951212