summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBurdetteLamar <burdettelamar@yahoo.com>2025-12-15 20:20:25 +0000
committerPeter Zhu <peter@peterzhu.ca>2025-12-15 17:27:24 -0500
commit7fbf321d23f3cc20988c80fae25ce131a5d1b231 (patch)
tree0c67d657e66eecc682a39fdd55ed4fd2d46b9e33
parent98ab418fed61079f8ef7e229ea1b41957ec5722b (diff)
[DOC] Harmonize #** methods
-rw-r--r--complex.c4
-rw-r--r--numeric.c11
-rw-r--r--rational.c4
3 files changed, 9 insertions, 10 deletions
diff --git a/complex.c b/complex.c
index 12dec4d23b..c34c798a15 100644
--- a/complex.c
+++ b/complex.c
@@ -1122,9 +1122,9 @@ complex_pow_for_special_angle(VALUE self, VALUE other)
/*
* call-seq:
- * complex ** numeric -> new_complex
+ * self ** exponent -> complex
*
- * Returns +self+ raised to power +numeric+:
+ * Returns +self+ raised to the power +exponent+:
*
* Complex.rect(0, 1) ** 2 # => (-1+0i)
* Complex.rect(-8) ** Rational(1, 3) # => (1.0000000000000002+1.7320508075688772i)
diff --git a/numeric.c b/numeric.c
index f96535cd24..cb3ca12904 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1390,9 +1390,9 @@ flo_divmod(VALUE x, VALUE y)
/*
* call-seq:
- * self ** other -> numeric
+ * self ** exponent -> numeric
*
- * Raises +self+ to the power of +other+:
+ * Returns +self+ raised to the power +exponent+:
*
* f = 3.14
* f ** 2 # => 9.8596
@@ -4623,9 +4623,9 @@ rb_int_divmod(VALUE x, VALUE y)
/*
* call-seq:
- * self ** numeric -> numeric_result
+ * self ** exponent -> numeric
*
- * Raises +self+ to the power of +numeric+:
+ * Returns +self+ raised to the power +exponent+:
*
* 2 ** 3 # => 8
* 2 ** -3 # => (1/8)
@@ -4748,8 +4748,7 @@ fix_pow(VALUE x, VALUE y)
* call-seq:
* self ** exponent -> numeric
*
- * Returns the value of base +self+ raised to the power +exponent+;
- * see {Exponentiation}[https://en.wikipedia.org/wiki/Exponentiation]:
+ * Returns +self+ raised to the power +exponent+:
*
* # Result for non-negative Integer exponent is Integer.
* 2 ** 0 # => 1
diff --git a/rational.c b/rational.c
index 7c2bd0b1eb..8c9b80cb62 100644
--- a/rational.c
+++ b/rational.c
@@ -984,9 +984,9 @@ nurat_fdiv(VALUE self, VALUE other)
/*
* call-seq:
- * rat ** numeric -> numeric
+ * self ** exponent -> numeric
*
- * Performs exponentiation.
+ * Returns +self+ raised to the power +exponent+:
*
* Rational(2) ** Rational(3) #=> (8/1)
* Rational(10) ** -2 #=> (1/100)