From 084b44e79dd456c9ce09ac06c6faf538160ac6b0 Mon Sep 17 00:00:00 2001 From: BurdetteLamar Date: Tue, 19 Dec 2023 09:19:00 -0600 Subject: RDoc for Complex --- complex.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'complex.c') diff --git a/complex.c b/complex.c index 1dd396c4a8..256a5f8ab4 100644 --- a/complex.c +++ b/complex.c @@ -1510,7 +1510,7 @@ nucomp_denominator(VALUE self) * c.numerator # => (8+9i) * * In this example, the lowest common denominator of the two parts is 12; - * the two converted parts may be thought of as \Complex(8, 12) and \Complex(9, 12), + * the two converted parts may be thought of as \Rational(8, 12) and \Rational(9, 12), * whose numerators, respectively, are 8 and 9; * so the returned value of c.numerator is Complex(8, 9). * @@ -1607,15 +1607,16 @@ f_format(VALUE self, VALUE (*func)(VALUE)) /* * call-seq: - * cmp.to_s -> string + * to_s -> string * - * Returns the value as a string. + * Returns a string representation of +self+: + * + * Complex(2).to_s # => "2+0i" + * Complex('-8/6').to_s # => "-4/3+0i" + * Complex('1/2i').to_s # => "0+1/2i" + * Complex(0, Float::INFINITY).to_s # => "0+Infinity*i" + * Complex(Float::NAN, Float::NAN).to_s # => "NaN+NaN*i" * - * Complex(2).to_s #=> "2+0i" - * Complex('-8/6').to_s #=> "-4/3+0i" - * Complex('1/2i').to_s #=> "0+1/2i" - * Complex(0, Float::INFINITY).to_s #=> "0+Infinity*i" - * Complex(Float::NAN, Float::NAN).to_s #=> "NaN+NaN*i" */ static VALUE nucomp_to_s(VALUE self) @@ -1625,15 +1626,16 @@ nucomp_to_s(VALUE self) /* * call-seq: - * cmp.inspect -> string + * inspect -> string + * + * Returns a string representation of +self+: * - * Returns the value as a string for inspection. + * Complex(2).inspect # => "(2+0i)" + * Complex('-8/6').inspect # => "((-4/3)+0i)" + * Complex('1/2i').inspect # => "(0+(1/2)*i)" + * Complex(0, Float::INFINITY).inspect # => "(0+Infinity*i)" + * Complex(Float::NAN, Float::NAN).inspect # => "(NaN+NaN*i)" * - * Complex(2).inspect #=> "(2+0i)" - * Complex('-8/6').inspect #=> "((-4/3)+0i)" - * Complex('1/2i').inspect #=> "(0+(1/2)*i)" - * Complex(0, Float::INFINITY).inspect #=> "(0+Infinity*i)" - * Complex(Float::NAN, Float::NAN).inspect #=> "(NaN+NaN*i)" */ static VALUE nucomp_inspect(VALUE self) -- cgit v1.2.3