Class: Noyes::FloatAssembler

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_impl/compression.rb

Overview

Reassembles a float that has been dissassembled using FloatSplitter.

Instance Method Summary collapse

Instance Method Details

#<<(data) ⇒ Object


74
75
76
77
78
# File 'lib/ruby_impl/compression.rb', line 74

def << data
  data.map do |signbit, exponent, significand|
    bits = signbit << 31 | 127 + exponent << 23 | significand
  end.pack('N*').unpack('g*')
end