diff options
author | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-02-22 15:46:43 +0000 |
---|---|---|
committer | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-02-22 15:46:43 +0000 |
commit | 3f1d2dd8723d5b797d709d17a909826f7a7ee892 (patch) | |
tree | 75801be3ea051729d38aae37e0a0c482f6924384 /rational.c | |
parent | 5318154fe1ac6f8dff014988488b9e063988a105 (diff) |
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] [ruby-core:79607] [Bug #13233]
Author: Marcus Stollsteimer <sto.mar@web.de>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r-- | rational.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/rational.c b/rational.c index 24e81b8af1..13c44f7925 100644 --- a/rational.c +++ b/rational.c @@ -1252,8 +1252,8 @@ nurat_negative_p(VALUE self) * * Returns the absolute value of +rat+. * - * (1/2r).abs #=> 1/2r - * (-1/2r).abs #=> 1/2r + * (1/2r).abs #=> 1/2r + * (-1/2r).abs #=> 1/2r * * Rational#magnitude is an alias of Rational#abs. */ @@ -1289,8 +1289,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 @@ -1430,9 +1429,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" @@ -1454,9 +1453,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" @@ -1478,9 +1477,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" @@ -1503,9 +1502,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" |