From: Brian Candler Date: 2007-08-15T14:48:23+09:00 Subject: Re: pack/unpack 64bit Integers On Wed, Aug 15, 2007 at 06:45:04AM +0100, Brian Candler wrote: > On Wed, Aug 15, 2007 at 06:50:01AM +0900, Hadmut Danisch wrote: > > do the pack and unpack procedures support 64 bit signed/unsigned > > integers? > > The documentation is at http://www.ruby-doc.org/core/ > In the top right-hand frame, click on pack(Array) or unpack(String). irb(main):001:0> str = [0x8877665544332211].pack("Q") => "\021\"3DUfw\210" irb(main):002:0> str.unpack("Q") => [9833440827789222417] irb(main):003:0> str.unpack("Q").first.to_s(16) => "8877665544332211" irb(main):004:0> str.unpack("q") => [-8613303245920329199] irb(main):005:0> str.unpack("q").first.to_s(16) => "-778899aabbccddef" irb(main):006:0>