summaryrefslogtreecommitdiff
path: root/NEWS
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-06-04 21:41:02 -0700
committerJeremy Evans <code@jeremyevans.net>2019-06-19 10:50:58 -0700
commitb9ef35e4c6325864e013ab6e45df6fe00f759a47 (patch)
tree0e3814c316dd16034139a4b2802a69aca469da7c /NEWS
parent65944e96d39a8ae3602751f49cb337335b2c6c45 (diff)
Implement Complex#<=>
Implement Complex#<=> so that it is usable as an argument when calling <=> on objects of other classes (since #coerce will coerce such numbers to Complex). If the complex number has a zero imaginary part, and the other argument is a real number (or complex number with zero imaginary part), return -1, 0, or 1. Otherwise, return nil, indicating the objects are not comparable. Fixes [Bug #15857]
Diffstat (limited to 'NEWS')
-rw-r--r--NEWS7
1 files changed, 7 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 0f612533ff..ef5b30151b 100644
--- a/NEWS
+++ b/NEWS
@@ -62,6 +62,13 @@ sufficient information, see the ChangeLog file or Redmine
=== Core classes updates (outstanding ones only)
+Complex::
+
+ New method::
+
+ * Added Complex#<=>. So 0 <=> 0i will not raise NoMethodError.
+ [Bug #15857]
+
Enumerable::
New method::