--- ext/bigdecimal/bigdecimal.c 2014-12-06 14:24:45.000000000 +0100 +++ ext/bigdecimal/bigdecimal.c 2014-12-06 14:28:15.000000000 +0100 @@ -362,9 +362,9 @@ * Method used to provide marshalling support. * * inf = BigDecimal.new('Infinity') - * => # + * #=> # * BigDecimal._load(inf._dump) - * => # + * #=> # * * See the Marshal module. */ @@ -613,7 +613,7 @@ return pv; } -/* Returns True if the value is Not a Number */ +/* Returns True if the value is Not a Number. */ static VALUE BigDecimal_IsNaN(VALUE self) { @@ -634,7 +634,7 @@ return Qnil; } -/* Returns True if the value is finite (not NaN or infinite) */ +/* Returns True if the value is finite (not NaN or infinite). */ static VALUE BigDecimal_IsFinite(VALUE self) { @@ -798,8 +798,8 @@ * be coerced into a BigDecimal value. * * e.g. - * a = BigDecimal.new("1.0") - * b = a / 2.0 -> 0.5 + * a = BigDecimal.new("1.0") + * b = a / 2.0 #=> 0.5 * * Note that coercing a String to a BigDecimal is not supported by default; * it requires a special compile-time option when building Ruby. @@ -857,8 +857,8 @@ * c = a + b * * digits:: If specified and less than the number of significant digits of the - * result, the result is rounded to that number of digits, according to - * BigDecimal.mode. + * result, the result is rounded to that number of digits, according + * to BigDecimal.mode. */ static VALUE BigDecimal_add(VALUE self, VALUE r) @@ -902,7 +902,7 @@ } /* call-seq: - * value - digits -> bigdecimal + * a - b -> bigdecimal * * Subtract the specified value. * @@ -1086,7 +1086,7 @@ * * Values may be coerced to perform the comparison: * - * BigDecimal.new('1.0') == 1.0 -> true + * BigDecimal.new('1.0') == 1.0 -> true */ static VALUE BigDecimal_eq(VALUE self, VALUE r) @@ -1178,8 +1178,8 @@ * c = a * b * * digits:: If specified and less than the number of significant digits of the - * result, the result is rounded to that number of digits, according to - * BigDecimal.mode. + * result, the result is rounded to that number of digits, according + * to BigDecimal.mode. */ static VALUE BigDecimal_mult(VALUE self, VALUE r) @@ -1252,8 +1252,8 @@ * c = a.div(b,n) * * digits:: If specified and less than the number of significant digits of the - * result, the result is rounded to that number of digits, according to - * BigDecimal.mode. + * result, the result is rounded to that number of digits, according + * to BigDecimal.mode. * * If digits is 0, the result is the same as the / operator. If not, the * result is an integer BigDecimal, by analogy with Float#div. @@ -1432,7 +1432,10 @@ return Qnil; } -/* Returns the remainder from dividing by the value. +/* call-seq: + * remainder(value) + * + * Returns the remainder from dividing by the value. * * x.remainder(y) means x-y*(x/y).truncate */ @@ -1446,21 +1449,24 @@ return ToValue(rv); } -/* Divides by the specified value, and returns the quotient and modulus +/* call-seq: + * divmod(value) + * + * Divides by the specified value, and returns the quotient and modulus * as BigDecimal numbers. The quotient is rounded towards negative infinity. * * For example: * - * require 'bigdecimal' + * require 'bigdecimal' * - * a = BigDecimal.new("42") - * b = BigDecimal.new("9") + * a = BigDecimal.new("42") + * b = BigDecimal.new("9") * - * q,m = a.divmod(b) + * q, m = a.divmod(b) * - * c = q * b + m + * c = q * b + m * - * a == c -> true + * a == c #=> true * * The quotient q is (a/b).floor, and the modulus is the amount that must be * added to q * b to get a. @@ -1547,7 +1553,7 @@ } } -/* +/* call-seq: * sub(value, digits) -> bigdecimal * * Subtract the specified value. @@ -1556,8 +1562,8 @@ * c = a.sub(b,n) * * digits:: If specified and less than the number of significant digits of the - * result, the result is rounded to that number of digits, according to - * BigDecimal.mode. + * result, the result is rounded to that number of digits, according + * to BigDecimal.mode. * */ static VALUE @@ -1597,9 +1603,8 @@ /* Returns the absolute value, as a BigDecimal. * - * BigDecimal('5').abs -> 5 - * - * BigDecimal('-3').abs -> 3 + * BigDecimal('5').abs #=> 5 + * BigDecimal('-3').abs #=> 3 */ static VALUE BigDecimal_abs(VALUE self) @@ -1894,14 +1899,14 @@ * * Examples: * - * BigDecimal.new('-123.45678901234567890').to_s('5F') - * #=> '-123.45678 90123 45678 9' + * BigDecimal.new('-123.45678901234567890').to_s('5F') + * #=> '-123.45678 90123 45678 9' * - * BigDecimal.new('123.45678901234567890').to_s('+8F') - * #=> '+123.45678901 23456789' + * BigDecimal.new('123.45678901234567890').to_s('+8F') + * #=> '+123.45678901 23456789' * - * BigDecimal.new('123.45678901234567890').to_s(' F') - * #=> ' 123.4567890123456789' + * BigDecimal.new('123.45678901234567890').to_s(' F') + * #=> ' 123.4567890123456789' */ static VALUE BigDecimal_to_s(int argc, VALUE *argv, VALUE self) @@ -2041,8 +2046,8 @@ /* Returns debugging information about the value as a string of comma-separated * values in angle brackets with a leading #: * - * BigDecimal.new("1234.5678").inspect -> - * "#" + * BigDecimal.new("1234.5678").inspect + * #=> "#" * * The first part is the address, the second is the value as a string, and * the final part ss(mm) is the current number of significant digits and the @@ -2196,7 +2201,7 @@ * * Note that n must be an Integer. * - * Also available as the operator ** + * Also available as the operator **. */ static VALUE BigDecimal_power(int argc, VALUE*argv, VALUE self) @@ -2428,9 +2433,11 @@ } /* call-seq: - * big_decimal ** exp -> big_decimal + * a ** n -> bigdecimal + * + * Returns the value raised to the power of n. * - * It is a synonym of BigDecimal#power(exp). + * See BigDecimal#power. */ static VALUE BigDecimal_power_op(VALUE self, VALUE exp)