Module: RaaP::Type::Arithmetic
- Defined in:
- lib/raap/type.rb
Class Method Summary collapse
Class Method Details
.float ⇒ Object
10 11 12 |
# File 'lib/raap/type.rb', line 10 def self.float positive_float.then { |x| [x, -x].sample or raise } end |
.positive_float ⇒ Object
14 15 16 17 |
# File 'lib/raap/type.rb', line 14 def self.positive_float x = Random.rand x / Math.sqrt(1 - (x * x)) end |