class Contracts::Builtin::Num

Public Class Methods

generate(min: -2e31.to_f, max: (2e31 - 1).to_f) click to toggle source
# File lib/contracts/builtin_ext.rb, line 11
def self.generate(min: -2e31.to_f, max: (2e31 - 1).to_f)
  raise 'min should not be greater than max' if min > max
  Random.rand(min..max)
end