From: Guillaume Marcais Date: 2004-05-07T00:49:05+09:00 Subject: Re: Working in hex What about: irb(main):001:0> val = 0xe8b8 + (4 * 110) => 60016 irb(main):002:0> val.to_s(16) => "ea70" I think you are confused between the internal representation of a number and its text representation. Guillaume. On Thu, 2004-05-06 at 11:31, Mark Probert wrote: > > Hello, rubyists. > > I need to do the following: > > val = 0xe8b8 + (4 * 110).hex > = 0xe8b8 + 1b8 > = 0xea70 > > Is there an easy way in Ruby of doing this? > I need to have the result in hex. > > -mark.