Method: Radix::Float#split_digits
- Defined in:
- lib/radix/float.rb
#split_digits(value) ⇒ Array<(Array<Fixnum>, Array<Fixnum>)> (private)
Returns the I-Part and F-Part of the passed value as arrays of fixnums.
431 432 433 434 435 436 437 438 439 440 |
# File 'lib/radix/float.rb', line 431 def split_digits(value) if d = value.index(DOT) || value.index('.') i, f = value[0...d], value[d+1..-1] else i, f = value, [0] end i.map!{ |x| x.to_i } f.map!{ |x| x.to_i } return i, f end |