Skip to content

Commit 2d01406

Browse files
BurdetteLamarpeterzhu2118
authored andcommitted
[DOC] Harmonize rb_div methods
1 parent 5e27581 commit 2d01406

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

complex.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -999,9 +999,9 @@ f_divide(VALUE self, VALUE other,
999999

10001000
/*
10011001
* call-seq:
1002-
* complex / numeric -> new_complex
1002+
* self / other -> complex
10031003
*
1004-
* Returns the quotient of +self+ and +numeric+:
1004+
* Returns the quotient of +self+ and +other+:
10051005
*
10061006
* Complex.rect(2, 3) / Complex.rect(2, 3) # => (1+0i)
10071007
* Complex.rect(900) / Complex.rect(1) # => (900+0i)

numeric.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,7 @@ rb_flo_div_flo(VALUE x, VALUE y)
11751175
* call-seq:
11761176
* self / other -> numeric
11771177
*
1178-
* Returns a new \Float which is the result of dividing +self+ by +other+:
1178+
* Returns the quotient of +self+ and +other+:
11791179
*
11801180
* f = 3.14
11811181
* f / 2 # => 1.57
@@ -4386,16 +4386,18 @@ fix_div(VALUE x, VALUE y)
43864386

43874387
/*
43884388
* call-seq:
4389-
* self / numeric -> numeric_result
4389+
* self / other -> numeric
43904390
*
4391-
* Performs division; for integer +numeric+, truncates the result to an integer:
4391+
* Returns the quotient of +self+ and +other+.
4392+
*
4393+
* For integer +other+, truncates the result to an integer:
43924394
*
43934395
* 4 / 3 # => 1
43944396
* 4 / -3 # => -2
43954397
* -4 / 3 # => -2
43964398
* -4 / -3 # => 1
43974399
*
4398-
* For other +numeric+, returns non-integer result:
4400+
* For non-integer +other+, returns a non-integer result:
43994401
*
44004402
* 4 / 3.0 # => 1.3333333333333333
44014403
* 4 / Rational(3, 1) # => (4/3)

rational.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -911,10 +911,9 @@ rb_rational_mul(VALUE self, VALUE other)
911911

912912
/*
913913
* call-seq:
914-
* rat / numeric -> numeric
915-
* rat.quo(numeric) -> numeric
914+
* self / other -> numeric
916915
*
917-
* Performs division.
916+
* Returns the quotient of +self+ and +other+:
918917
*
919918
* Rational(2, 3) / Rational(2, 3) #=> (1/1)
920919
* Rational(900) / Rational(1) #=> (900/1)

0 commit comments

Comments
 (0)