Method: FloatString#inner_insert
- Defined in:
- lib/carat/floatstring.rb
#inner_insert(s, i) ⇒ Object
these should probably check the decimal and start there rather then startint at 0.5
52 53 54 55 56 57 58 59 |
# File 'lib/carat/floatstring.rb', line 52 def inner_insert(s, i) n = 0.5; i = i.to_f - n while @float.has_key?(i) n = n/2 i += n end @float[i] = s end |