From 3535039980181c031ed48cdc7bd33973642b7144 Mon Sep 17 00:00:00 2001 From: usa Date: Wed, 31 Jan 2018 11:03:46 +0000 Subject: merge revision(s) 57686: [Backport #13233] rational.c: fix rdoc * rational.c: [DOC] fix wrong indentations and comment out some lines in code examples to make them valid Ruby code and syntax highlighted on the rendered page. [ci skip] [Bug #13233] Author: Marcus Stollsteimer sto.mar@web.de git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@62126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- rational.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'rational.c') diff --git a/rational.c b/rational.c index ca65518c82..97fb16ddd6 100644 --- a/rational.c +++ b/rational.c @@ -1247,8 +1247,7 @@ nurat_ceil(VALUE self) * * Returns the truncated value as an integer. * - * Equivalent to - * rat.truncate. + * Equivalent to Rational#truncate. * * Rational(2, 3).to_i #=> 0 * Rational(3).to_i #=> 3 @@ -1336,9 +1335,9 @@ f_round_common(int argc, VALUE *argv, VALUE self, VALUE (*func)(VALUE)) * Rational(2, 3).floor #=> 0 * Rational(-3, 2).floor #=> -1 * - * decimal - 1 2 3 . 4 5 6 - * ^ ^ ^ ^ ^ ^ - * precision -3 -2 -1 0 +1 +2 + * # decimal - 1 2 3 . 4 5 6 + * # ^ ^ ^ ^ ^ ^ + * # precision -3 -2 -1 0 +1 +2 * * '%f' % Rational('-123.456').floor(+1) #=> "-123.500000" * '%f' % Rational('-123.456').floor(-1) #=> "-130.000000" @@ -1360,9 +1359,9 @@ nurat_floor_n(int argc, VALUE *argv, VALUE self) * Rational(2, 3).ceil #=> 1 * Rational(-3, 2).ceil #=> -1 * - * decimal - 1 2 3 . 4 5 6 - * ^ ^ ^ ^ ^ ^ - * precision -3 -2 -1 0 +1 +2 + * # decimal - 1 2 3 . 4 5 6 + * # ^ ^ ^ ^ ^ ^ + * # precision -3 -2 -1 0 +1 +2 * * '%f' % Rational('-123.456').ceil(+1) #=> "-123.400000" * '%f' % Rational('-123.456').ceil(-1) #=> "-120.000000" @@ -1384,9 +1383,9 @@ nurat_ceil_n(int argc, VALUE *argv, VALUE self) * Rational(2, 3).truncate #=> 0 * Rational(-3, 2).truncate #=> -1 * - * decimal - 1 2 3 . 4 5 6 - * ^ ^ ^ ^ ^ ^ - * precision -3 -2 -1 0 +1 +2 + * # decimal - 1 2 3 . 4 5 6 + * # ^ ^ ^ ^ ^ ^ + * # precision -3 -2 -1 0 +1 +2 * * '%f' % Rational('-123.456').truncate(+1) #=> "-123.400000" * '%f' % Rational('-123.456').truncate(-1) #=> "-120.000000" @@ -1409,9 +1408,9 @@ nurat_truncate_n(int argc, VALUE *argv, VALUE self) * Rational(2, 3).round #=> 1 * Rational(-3, 2).round #=> -2 * - * decimal - 1 2 3 . 4 5 6 - * ^ ^ ^ ^ ^ ^ - * precision -3 -2 -1 0 +1 +2 + * # decimal - 1 2 3 . 4 5 6 + * # ^ ^ ^ ^ ^ ^ + * # precision -3 -2 -1 0 +1 +2 * * '%f' % Rational('-123.456').round(+1) #=> "-123.500000" * '%f' % Rational('-123.456').round(-1) #=> "-120.000000" -- cgit v1.2.3