Generates random floating-point numbers in a half-open range.
Reversed bounds are automatically normalised.
Lower bound (inclusive). Defaults to 0; swapped with max when out of order.
0
max
Upper bound (exclusive). Defaults to 1; swapped with min when out of order.
1
min
A uniformly random float in [min, max).
[min, max)
randomFloat(10, 20); // 10 <= n < 20randomFloat(20, 10); // same as randomFloat(10, 20)randomFloat(); // 0 <= n < 1 (default range) Copy
randomFloat(10, 20); // 10 <= n < 20randomFloat(20, 10); // same as randomFloat(10, 20)randomFloat(); // 0 <= n < 1 (default range)
Generates random floating-point numbers in a half-open range.
Reversed bounds are automatically normalised.