From f0b86f8c6098edfe47c4735d061e50e017d7e94d Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Tue, 19 Dec 2023 14:32:54 -0600 Subject: RDoc for Complex --- complex.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'complex.c') 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 self.real.finite? and self.imag.finite? + * 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 self.real.infinite? or self.imag.infinite? + * 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) -- cgit v1.2.3