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: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>