Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 669 Bytes

rand.md

File metadata and controls

25 lines (18 loc) · 669 Bytes

rand

Returns a randomly generated number.

rand 10        # returns an integer i, 0 <= i < 10
rand 10.0      # returns a float f, 0.0 <= f < 10.0
rand 1 11      # returns an integer i, 1 <= i < 11
rand 1.0 11    # returns a float f, 1.0 <= f < 11.0
rand 1 11.0    # returns a float f, 1.0 <= f < 11.0
rand 1.0 11.0  # returns a float f, 1.0 <= f < 11.0

When give no argument, it simply takes the current payload['ret']

sequence
  10
  rand  # returns an integer i, 0 <= i < 10