From: 7stud -- Date: 2012-12-22T16:53:47+09:00 Subject: Re: simple division: -9 / 5 = -2 what? Derrick B. wrote in post #1089918: > $ irb > irb(main):001:0> -9 / 5 > => -2 > irb(main):002:0> -9.to_f / 5.to_f > => -1.8 > irb(main):003:0> (-9.to_f / 5.to_f).to_i > => -1 > > If I want to assign the integer quotient of the above example, do I > really need to go from float to integer? > No: p -9.divmod 5 --output:-- [-2, 1] -- Posted via http://www.ruby-forum.com/.