@@ -184,23 +184,24 @@ class Complex < Numeric
184184
185185 # <!--
186186 # rdoc-file=complex.c
187- # - complex * numeric -> new_complex
187+ # - self * other -> numeric
188188 # -->
189- # Returns the product of `self` and `numeric `:
189+ # Returns the numeric product of `self` and `other `:
190190 #
191+ # Complex.rect(9, 8) * 4 # => (36+32i)
192+ # Complex.rect(20, 9) * 9.8 # => (196.0+88.2i)
191193 # Complex.rect(2, 3) * Complex.rect(2, 3) # => (-5+12i)
192194 # Complex.rect(900) * Complex.rect(1) # => (900+0i)
193195 # Complex.rect(-2, 9) * Complex.rect(-9, 2) # => (0-85i)
194- # Complex.rect(9, 8) * 4 # => (36+32i)
195- # Complex.rect(20, 9) * 9.8 # => (196.0+88.2i)
196+ # Complex.rect(9, 8) * Rational(2, 3) # => ((6/1)+(16/3)*i)
196197 #
197198 def * : (Numeric) -> Complex
198199
199200 # <!--
200201 # rdoc-file=complex.c
201- # - complex ** numeric -> new_complex
202+ # - self ** exponent -> complex
202203 # -->
203- # Returns `self` raised to power `numeric `:
204+ # Returns `self` raised to the power `exponent `:
204205 #
205206 # Complex.rect(0, 1) ** 2 # => (-1+0i)
206207 # Complex.rect(-8) ** Rational(1, 3) # => (1.0000000000000002+1.7320508075688772i)
@@ -209,23 +210,33 @@ class Complex < Numeric
209210
210211 # <!--
211212 # rdoc-file=complex.c
212- # - complex + numeric -> new_complex
213+ # - self + other -> numeric
213214 # -->
214- # Returns the sum of `self` and `numeric`:
215+ # Returns the sum of `self` and `other`:
216+ #
217+ # Complex(1, 2) + 0 # => (1+2i)
218+ # Complex(1, 2) + 1 # => (2+2i)
219+ # Complex(1, 2) + -1 # => (0+2i)
220+ #
221+ # Complex(1, 2) + 1.0 # => (2.0+2i)
222+ #
223+ # Complex(1, 2) + Complex(2, 1) # => (3+3i)
224+ # Complex(1, 2) + Complex(2.0, 1.0) # => (3.0+3.0i)
225+ #
226+ # Complex(1, 2) + Rational(1, 1) # => ((2/1)+2i)
227+ # Complex(1, 2) + Rational(1, 2) # => ((3/2)+2i)
228+ #
229+ # For a computation involving Floats, the result may be inexact (see Float#+):
215230 #
216- # Complex.rect(2, 3) + Complex.rect(2, 3) # => (4+6i)
217- # Complex.rect(900) + Complex.rect(1) # => (901+0i)
218- # Complex.rect(-2, 9) + Complex.rect(-9, 2) # => (-11+11i)
219- # Complex.rect(9, 8) + 4 # => (13+8i)
220- # Complex.rect(20, 9) + 9.8 # => (29.8+9i)
231+ # Complex(1, 2) + 3.14 # => (4.140000000000001+2i)
221232 #
222233 def + : (Numeric) -> Complex
223234
224235 # <!--
225236 # rdoc-file=complex.c
226- # - complex - numeric -> new_complex
237+ # - self - other -> complex
227238 # -->
228- # Returns the difference of `self` and `numeric `:
239+ # Returns the difference of `self` and `other `:
229240 #
230241 # Complex.rect(2, 3) - Complex.rect(2, 3) # => (0+0i)
231242 # Complex.rect(900) - Complex.rect(1) # => (899+0i)
@@ -237,9 +248,9 @@ class Complex < Numeric
237248
238249 # <!--
239250 # rdoc-file=complex.c
240- # - -complex -> new_complex
251+ # - -self -> complex
241252 # -->
242- # Returns the negation of `self`, which is the negation of each of its parts:
253+ # Returns `self`, negated , which is the negation of each of its parts:
243254 #
244255 # -Complex.rect(1, 2) # => (-1-2i)
245256 # -Complex.rect(-1, -2) # => (1+2i)
@@ -248,9 +259,9 @@ class Complex < Numeric
248259
249260 # <!--
250261 # rdoc-file=complex.c
251- # - complex / numeric -> new_complex
262+ # - self / other -> complex
252263 # -->
253- # Returns the quotient of `self` and `numeric `:
264+ # Returns the quotient of `self` and `other `:
254265 #
255266 # Complex.rect(2, 3) / Complex.rect(2, 3) # => (1+0i)
256267 # Complex.rect(900) / Complex.rect(1) # => (900+0i)
@@ -597,9 +608,9 @@ class Complex < Numeric
597608
598609 # <!--
599610 # rdoc-file=complex.c
600- # - complex / numeric -> new_complex
611+ # - self / other -> complex
601612 # -->
602- # Returns the quotient of `self` and `numeric `:
613+ # Returns the quotient of `self` and `other `:
603614 #
604615 # Complex.rect(2, 3) / Complex.rect(2, 3) # => (1+0i)
605616 # Complex.rect(900) / Complex.rect(1) # => (900+0i)
0 commit comments