From: Morton Goldberg Date: 2007-02-16T00:47:03+09:00 Subject: Re: Converting Bytes to a Negative Integer On Feb 14, 2007, at 6:37 PM, James Edward Gray II wrote: > 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 I see your point. Many new computers have 64-bit CPUs and we should remember that. Also, you want to be sure I, lowly 32-bit CPU owner, envy you for having one of these . Regards, Morton