summaryrefslogtreecommitdiff
path: root/complex.c
diff options
context:
space:
mode:
authorBurdetteLamar <burdettelamar@yahoo.com>2023-12-19 14:32:54 -0600
committerPeter Zhu <peter@peterzhu.ca>2023-12-19 17:29:09 -0500
commitf0b86f8c6098edfe47c4735d061e50e017d7e94d (patch)
treeebc141ee278b814524c7f3f16b0a1e107da35865 /complex.c
parent054f56fd3e5bf84e5443896fd1f4e439c2773c60 (diff)
RDoc for Complex
Diffstat (limited to 'complex.c')
-rw-r--r--complex.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/complex.c b/complex.c
index 256a5f8ab4..5b91c5f240 100644
--- a/complex.c
+++ b/complex.c
@@ -1653,10 +1653,15 @@ nucomp_inspect(VALUE self)
/*
* call-seq:
- * cmp.finite? -> true or false
+ * finite? -> true or false
*
- * Returns +true+ if +cmp+'s real and imaginary parts are both finite numbers,
- * otherwise returns +false+.
+ * Returns +true+ if both <tt>self.real.finite?</tt> and <tt>self.imag.finite?</tt>
+ * are true, +false+ otherwise:
+ *
+ * Complex(1, 1).finite? # => true
+ * Complex(Float::INFINITY, 0).finite? # => false
+ *
+ * Related: Numeric#finite?, Float#finite?.
*/
static VALUE
rb_complex_finite_p(VALUE self)
@@ -1668,15 +1673,15 @@ rb_complex_finite_p(VALUE self)
/*
* call-seq:
- * cmp.infinite? -> nil or 1
+ * infinite? -> 1 or nil
*
- * Returns +1+ if +cmp+'s real or imaginary part is an infinite number,
- * otherwise returns +nil+.
+ * Returns +1+ if either <tt>self.real.infinite?</tt> or <tt>self.imag.infinite?</tt>
+ * is true, +nil+ otherwise:
*
- * For example:
+ * Complex(Float::INFINITY, 0).infinite? # => 1
+ * Complex(1, 1).infinite? # => nil
*
- * (1+1i).infinite? #=> nil
- * (Float::INFINITY + 1i).infinite? #=> 1
+ * Related: Numeric#infinite?, Float#infinite?.
*/
static VALUE
rb_complex_infinite_p(VALUE self)