Generate a random float below a value

rand

[max (number)]

Given a max number, produces a float between 0 and the supplied max value. With no args, returns a random value between 0 and 1.

Introduced in v2.0.0

Example 0 


print rand(0.5)



 
 #=> will print a number like 0.397730007820797 to the output pane