From: khaines@... Date: 2007-01-15T02:07:09+09:00 Subject: Re: how to translate base 10 number into base 2 number On Mon, 15 Jan 2007, chen li wrote: > Hi all, > > I want to write a method to tranlate base 10 number > into base 2 number. I want to call the method within > itself. But it doesn't work. What is the right way > to do something like this? This doesn't answer your question, but in case you were not aware, Ruby will do this conversion for you: a = 125 puts a.to_s(2) 1111101 Kirk Haines