Method: SuperRandom#rand
- Defined in:
- lib/super_random/super_random.rb
#rand(m = nil, n = 6) ⇒ Object
60 61 62 63 64 |
# File 'lib/super_random/super_random.rb', line 60 def rand(m=nil, n=6) div = n.times.inject(''){|s,i| s+'FF'}.to_i(16).to_f r = hexadecimal(n).to_i(16).to_f / div m.nil? ? r : (m*r).to_i end |