From: Jason Mayer Date: 2007-02-18T14:00:29+09:00 Subject: Re: modulus/division.. ------=_Part_26740_10946450.1171774826575 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 2/17/07, Derek Teixeira wrote: > > I understnad the first few lines .. the "while" stuff and and ending > stuff too. do you think you explain to me why the % and / works here? i > guess i really need to get better at math. i'm sorry if i'm being really > stupid here, hah. i just want to really understand things, not just see > and move on .. thank you again.. > > I find that when I'm trying to understand what's going on, the best way to figure it out is to use IRB E:\Documents and Settings\Jason>irb irb(main):001:0> input = 3123 => 3123 irb(main):002:0> m_mod = input%1000 => 123 irb(main):003:0> m_div = input/1000 => 3 irb(main):004:0> m = 'M' * m_div => "MMM" irb(main):006:0> puts m MMM => nil irb(main):007:0> You can probably figure out the rest from there. Hope that helps. ------=_Part_26740_10946450.1171774826575--