8000 RDoc for Complex · github/ruby@8ad8803 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8ad8803

Browse files
BurdetteLamarpeterzhu2118
authored andcommitted
RDoc for Complex
1 parent 42442ed commit 8ad8803

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

complex.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -789,8 +789,6 @@ rb_complex_real(VALUE self)
789789
*
790790
* Complex.polar(1, Math::PI/4).imag # => 0.7071067811865476 # Square root of 2.
791791
*
792-
* \Complex#imaginary is an alias for \Complex#imag.
793-
*
794792
*/
795793
VALUE
796794
rb_complex_imag(VALUE self)
@@ -1001,7 +999,6 @@ f_divide(VALUE self, VALUE other,
1001999
* Complex(9, 8) / 4 # => ((9/4)+(2/1)*i)
10021000
* Complex(20, 9) / 9.8 # => (2.0408163265306123+0.9183673469387754i)
10031001
*
1004-
* Complex#quo is an alias for Complex#/.
10051002
*/
10061003
VALUE
10071004
rb_complex_div(VALUE self, VALUE other)
@@ -1327,7 +1324,6 @@ nucomp_coerce(VALUE self, VALUE other)
13271324
*
13281325
* Complex.rectangular(1, 1).abs # => 1.4142135623730951 # The square root of 2.
13291326
*
1330-
* Complex#magnitude is an alias for Complex#abs.
13311327
*/
13321328
VALUE
13331329
rb_complex_abs(VALUE self)
@@ -1388,7 +1384,6 @@ nucomp_abs2(VALUE self)
13881384
*
13891385
* Complex.polar(1, 1.0/3).arg # => 0.33333333333333326
13901386
*
1391-
* Complex#angle and Complex#phase are aliases for Complex#arg.
13921387
*/
13931388
VALUE
13941389
rb_complex_arg(VALUE self)
@@ -1454,7 +1449,6 @@ nucomp_polar(VALUE self)
14541449
*
14551450
* Complex.rect(1, 2).conj # => (1-2i)
14561451
*
1457-
* Complex#conjugate is an alias for Complex#conj.
14581452
*/
14591453
VALUE
14601454
rb_complex_conjugate(VALUE self)
@@ -1547,6 +1541,18 @@ rb_complex_hash(VALUE self)
15471541
return v;
15481542
}
15491543

1544+
/*
1545+
* :call-seq:
1546+
* hash -> integer
1547+
*
1548+
* Returns the integer hash value for +self+.
1549+
*
1550+
* Two \Complex objects created from the same values will have the same hash value
1551+
* (and will compare using #eql?):
1552+
*
1553+
* Complex(1, 2).hash == Complex(1, 2).hash # => true
1554+
*
1555+
*/
15501556
static VALUE
15511557
nucomp_hash(VALUE self)
15521558
{

0 commit comments

Comments
 (0)
0