Skip to content

Commit 996c51b

Browse files
authored
Merge pull request #296 from franzliedke/patch-1
Extend docs for round(0) [ci skip]
2 parents ad4fec6 + e68e6cb commit 996c51b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/bigdecimal/bigdecimal.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2459,14 +2459,15 @@ BigDecimal_fix(VALUE self)
24592459
* round(n, mode)
24602460
*
24612461
* Round to the nearest integer (by default), returning the result as a
2462-
* BigDecimal if n is specified, or as an Integer if it isn't.
2462+
* BigDecimal if n is specified and positive, or as an Integer if it isn't.
24632463
*
24642464
* BigDecimal('3.14159').round #=> 3
24652465
* BigDecimal('8.7').round #=> 9
24662466
* BigDecimal('-9.9').round #=> -10
24672467
*
24682468
* BigDecimal('3.14159').round(2).class.name #=> "BigDecimal"
24692469
* BigDecimal('3.14159').round.class.name #=> "Integer"
2470+
* BigDecimal('3.14159').round(0).class.name #=> "Integer"
24702471
*
24712472
* If n is specified and positive, the fractional part of the result has no
24722473
* more than that many digits.

0 commit comments

Comments
 (0)