From: James Edward Gray II Date: 2007-02-15T08:37:45+09:00 Subject: Re: Converting Bytes to a Negative Integer On Feb 14, 2007, at 5:02 PM, Morton Goldberg wrote: > data = "" > [255, 255, 255, 236].each { |e| data << e } > data # => "\377\377\377\354" > data.unpack('l').first # => -20 Watch what happens when I run the same code: >> data = "" => "" >> [255, 255, 255, 236].each { |e| data << e } => [255, 255, 255, 236] >> data => "\377\377\377\354" >> data.unpack('l').first => -318767105 See my earlier post in this thread about this. James Edward Gray II