From: Jeremy Bopp Date: 2011-11-08T13:22:05+09:00 Subject: Re: Why does not this work? ------IBKR3MA2KXEFIBQQS99Q4HB9K0EDES Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5/9 is integer division, so it evaluates to 0. That is multiplied with i-32 which also evaluates to 0. The fix is to force floating point division by using at least one floating point literal in the division operation: c = (i-32)*(5.0/9) -Jeremy Erbay Yigit wrote: Hi guys, I am trying to learn Ruby. I know some Perl. I cannot make following script work. Could you please help me understand why "c" value in the code does not print. It prints "0" for me. Thank you for help. code: -------- temp1 = 1 temp2 = 15 puts "F:C" temp1.upto(temp2) do |i| c = (i-32)*(5/9) print i,':',c,"\n" end -------- -- Posted via http://www.ruby-forum.com/. ------IBKR3MA2KXEFIBQQS99Q4HB9K0EDES--