From: Patrick Thomson Date: 2010-05-14T09:38:01+09:00 Subject: [ruby-core:30231] [Bug #3289] Division of negative numbers Bug #3289: Division of negative numbers http://redmine.ruby-lang.org/issues/show/3289 Author: Patrick Thomson Status: Open, Priority: Normal Category: core ruby -v: 1.9.1 The documentation for Numeric (http://www.ruby-doc.org/core/classes/Numeric.html#M000179) states that integer divmod() (and, by extension, /) rounds the quotient towards negative infinity. Python and Tcl behave similarly, while C, Java, bc, and gdb round the quotient towards zero, as is taught in standard arithmetic courses. Is this a quirk of MRI's implementation, or is it desired Ruby behavior? If so, why? It's counterintuitive that (-x/y) ��� -(x/y), and even moreso when (-x/y) = -(x/y) if x or y is a non-integer. ---------------------------------------- http://redmine.ruby-lang.org