From: Jeremy Tregunna Date: 2007-01-15T02:20:47+09:00 Subject: Re: how to translate base 10 number into base 2 number On 14-Jan-07, at 12:19 PM, chen li wrote: > >> 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 > > Thanks. But is is possible do the opposite, from > 111101 to 125 change? "111101".to_i(2) => 125 -- Jeremy Tregunna jtregunna@blurgle.ca