From: William Rutiser Date: 2010-02-16T22:53:36+09:00 Subject: Re: Newbie needs help Gui Djos wrote: > William Rutiser wrote: > >> In Ruby, numbers without a decimal point are treated as integers. The >> result of dividing an integer by an integer is an integer with any >> remainder discarded. If either argument is a float, the result is a >> float without rounding or truncation. The "Float()" method only converts >> the result of its argument expression to float. Try dividing by 2.0 >> instead of 2. >> >> You should also look up the relative precedence of the ** and + >> operator, and while you have the book open, check on how Ruby deals with >> negative quotients of integers. >> >> -- Bill >> > > > Now that's a useful post. Rob's was nice too, and I appreciate it guys. > I'll have a look at all the info you gave me and try to see through this > one. > Thank you. By the way I think I ment ** and / in the remark about precedence, not +. It was late at night. Have fun with Ruby. -- Bill