We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents dbbccf4 + adbb902 commit fd05c11Copy full SHA for fd05c11
refm/api/src/_builtin/Complex
@@ -107,6 +107,27 @@ Complex(1, 0) == Complex(1) # => true
107
Complex(1, 0) == 1 # => true
108
#@end
109
110
+#@since 2.7.0
111
+--- <=>(other) -> -1 | 0 | 1 | nil
112
+
113
+self の虚部がゼロで other が実数の場合、
114
+self の実部の <=> メソッドで other と比較した結果を返します。
115
+other が Complex で虚部がゼロの場合も同様です。
116
117
+その他の場合は nil を返します。
118
119
+@param other 自身と比較する数値
120
121
+#@samplecode 例
122
+Complex(2, 3) <=> Complex(2, 3) #=> nil
123
+Complex(2, 3) <=> 1 #=> nil
124
+Complex(2) <=> 1 #=> 1
125
+Complex(2) <=> 2 #=> 0
126
+Complex(2) <=> 3 #=> -1
127
+#@end
128
129
130
131
--- abs -> Numeric
132
--- magnitude -> Numeric
133
0 commit comments