From: Chad Perrin Date: 2007-03-30T14:34:51+09:00 Subject: Re: same operation (sort of), different results On Fri, Mar 30, 2007 at 02:30:33PM +0900, Chad Perrin wrote: > I'm a little confused by these results. Perhaps someone can tell me > what I'm assuming incorrectly: > > $ irb > irb(main):001:0> 5 / 9 * ( 100 - 32 ) > => 0 > irb(main):002:0> ( 5 / 9 ) * ( 100 - 32 ) > => 0 > irb(main):004:0> ( 100 - 32 ) * ( 5 / 9 ) > => 0 > irb(main):003:0> ( 100 - 32 ) * 5 / 9 > => 37 > > The last result is the only one that gives me what I actually wanted. > > In case you're wondering, yes, that *is* an F-to-C temperature > conversion. Never mind, that was a full-on brain fart. I forgot I was doing integer division. Mea culpa. -- CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] Amazon.com interview candidate: "When C++ is your hammer, everything starts to look like your thumb."