summaryrefslogtreecommitdiff
path: root/spec/ruby/shared/basicobject/method_missing.rb
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 /spec/ruby/shared/basicobject/method_missing.rb
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 'spec/ruby/shared/basicobject/method_missing.rb')
0 files changed, 0 insertions, 0 deletions