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