From: mame@... Date: 2017-11-27T07:41:38+00:00 Subject: [ruby-core:83887] [Ruby trunk Feature#3289][Rejected] Division of negative numbers Issue #3289 has been updated by mame (Yusuke Endoh). Status changed from Assigned to Rejected I believe this ticket is hopeless. Closing. ---------------------------------------- Feature #3289: Division of negative numbers https://bugs.ruby-lang.org/issues/3289#change-67925 * Author: patrick_thomson (Patrick Thomson) * Status: Rejected * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * Target version: Next Major ---------------------------------------- =begin 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. =end -- https://bugs.ruby-lang.org/ Unsubscribe: