summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/numeric.c b/numeric.c
index 4b0fcf01e5..cf7905a77b 100644
--- a/numeric.c
+++ b/numeric.c
@@ -5010,7 +5010,7 @@ int_dotimes(VALUE num)
/*
* Document-method: Integer#round
* call-seq:
- * int.round([ndigits]) -> integer or float
+ * int.round([ndigits] [, half: symbol]) -> integer or float
*
* Rounds +int+ to a given precision in decimal digits (default 0 digits).
*
@@ -5020,6 +5020,15 @@ int_dotimes(VALUE num)
* 1.round #=> 1
* 1.round(2) #=> 1.0
* 15.round(-1) #=> 20
+ *
+ * The <code>half:</code> optional keyword same as Float#round is available.
+ *
+ * 25.round(-1, half: :up) #=> 30
+ * 25.round(-1, half: :even) #=> 20
+ * 25.round(-1, half: :down) #=> 20
+ * 35.round(-1, half: :up) #=> 40
+ * 35.round(-1, half: :even) #=> 40
+ * 35.round(-1, half: :down) #=> 30
*/
static VALUE