summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-11 13:30:55 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-02-11 13:30:55 +0000
commit1ad8521d44de917e759ff9d77d39f6f3f55215f5 (patch)
tree7c583d662917dbcab70733d0af1c0feaef11bd8d
parentc09bcd351af03eaadd44552f47a0fc85bf64075a (diff)
update rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--numeric.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/numeric.c b/numeric.c
index 97659e455d4..deeeaf42dc6 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1372,8 +1372,26 @@ flo_ceil(VALUE num)
* Precision may be negative. Returns a floating point number when ndigits
* is more than one.
*
+ * 1.4.round #=> 1
* 1.5.round #=> 2
+ * 1.6.round #=> 2
* (-1.5).round #=> -2
+ *
+ * 1.234567.round(2) #=> 1.23
+ * 1.234567.round(3) #=> 1.235
+ * 1.234567.round(4) #=> 1.2346
+ * 1.234567.round(5) #=> 1.23457
+ *
+ * 34567.89.round(-5) #=> 0
+ * 34567.89.round(-4) #=> 30000
+ * 34567.89.round(-3) #=> 35000
+ * 34567.89.round(-2) #=> 34600
+ * 34567.89.round(-1) #=> 34570
+ * 34567.89.round(0) #=> 34568
+ * 34567.89.round(1) #=> 34567.9
+ * 34567.89.round(2) #=> 34567.89
+ * 34567.89.round(3) #=> 34567.89
+ *
*/
static VALUE