From: Satish Talim Date: 2009-09-25T10:11:00+09:00 Subject: Re: Ruby Noob issue --0016e64ec0a2eef7e704745c9e9e Content-Type: text/plain; charset=ISO-8859-1 Fred, (5/9) is integer division. The decimal part is truncated leaving you with 0. Use (5.0/9) instead. Satish On Fri, Sep 25, 2009 at 6:37 AM, Fred Ige wrote: > Hi > I'm really new to Ruby > as such it took me about an hour to register ^^'... > That being said > > I am trying to figure out why this program I made keeps returning as "0" > > def f(x) > return (5/9) * (x-32) > end > x=1001 > print(f(x)) > > Not complicated at all > I'm just intending for the x value 1001 to plug its self into the > temperature equation and print that value > > Thanks for reading > -- > Posted via http://www.ruby-forum.com/. > > --0016e64ec0a2eef7e704745c9e9e--