Files
Digpkg/math/docs/random/random_double.md
2026-01-23 16:47:56 +11:00

677 B

math_RandomDouble

Generate a random double in the range provided.
IMPORTANT: math_RandomDouble is NOT cryptographically secure! Use the cryptography library instead!
If you want to generate a random integer, use math_Random.

Arguments

  • min (double): Smallest possible number
  • max (double): Largest possible number

Returns

randomNumber (double): A random number in the range provided

Example

call !math_RandomDouble 0.0 10.0 &randomNumber
println $randomNumber # 5.24...
call !math_RandomDouble 0.0 10.0 &randomNumber
println $randomNumber # 6.58...
call !math_RandomDouble 0.0 10.0 &randomNumber
println $randomNumber # 9.22...
...