Project

General

Profile

Bug #10576 » doc_bigdecimal_p3.patch

patch 3 - stomar (Marcus Stollsteimer), 12/06/2014 07:14 PM

View differences:

ext/bigdecimal/bigdecimal.c 2014-12-06 19:26:03.000000000 +0100
/* call-seq:
* round(n, mode)
*
* Round to the nearest 1 (by default), returning the result as a BigDecimal.
* Round to the nearest integer (by default), returning the result as a
* BigDecimal.
*
* BigDecimal('3.14159').round #=> 3
* BigDecimal('8.7').round #=> 9
* BigDecimal('-9.9').round #=> -10
*
* If n is specified and positive, the fractional part of the result has no
* more than that many digits.
......
/* call-seq:
* truncate(n)
*
* Truncate to the nearest 1, returning the result as a BigDecimal.
* Truncate to the nearest integer (by default), returning the result as a
* BigDecimal.
*
* BigDecimal('3.14159').truncate #=> 3
* BigDecimal('8.7').truncate #=> 8
* BigDecimal('-9.9').truncate #=> -9
*
* If n is specified and positive, the fractional part of the result has no
* more than that many digits.
(3-3/3)