diff options
| author | Jeremy Evans <code@jeremyevans.net> | 2019-06-04 21:41:02 -0700 |
|---|---|---|
| committer | Jeremy Evans <code@jeremyevans.net> | 2019-06-19 10:50:58 -0700 |
| commit | b9ef35e4c6325864e013ab6e45df6fe00f759a47 (patch) | |
| tree | 0e3814c316dd16034139a4b2802a69aca469da7c /spec/ruby/core/basicobject | |
| parent | 65944e96d39a8ae3602751f49cb337335b2c6c45 (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/core/basicobject')
0 files changed, 0 insertions, 0 deletions
