From: Florian Gross Date: 2007-06-07T22:55:46+09:00 Subject: Odd beaviour with Fixnum#div on negative numbers with floats Hi, I'm just going through Rubinius' specification suite making sure that the specs correctly match Matz' Ruby behaviour. Here's something odd I discovered (same behaviour on 1.8.4 (2005-12-24) and 1.9.0 (2007-04-02)): irb(main):001:0> -1.div(2.0) => 0 irb(main):002:0> -1.div(2) => -1 irb(main):003:0> -1.divmod(2.0) => [-1.0, 1.0] irb(main):004:0> -1.divmod(2) => [-1, 1] I'm on i686-darwin8.8.1. For PPC -1.div(2.0) produces -1. I think that the behaviour of .div should match .divmod in all cases for consistency reasons, but if there is a good explanation for the behaviour, please feel free to enlighten me. Thank you! Kind regards, Florian Gross