summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-31 11:03:46 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-31 11:03:46 +0000
commit3535039980181c031ed48cdc7bd33973642b7144 (patch)
tree3e638f7758aed30e0982ef3132832e4a78fcc4d4 /rational.c
parent305b200d107efff89eff285205067ce6854b8b99 (diff)
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
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c27
1 files changed, 13 insertions, 14 deletions
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"