ruby-changes:13017
From: nobu <ko1@a...>
Date: Sat, 5 Sep 2009 15:41:50 +0900 (JST)
Subject: [ruby-changes:13017] Ruby:r24762 (trunk): * numeric.c (flo_quo, int_round): added rdoc.
nobu 2009-09-05 15:41:40 +0900 (Sat, 05 Sep 2009) New Revision: 24762 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24762 Log: * numeric.c (flo_quo, int_round): added rdoc. Modified files: trunk/numeric.c Index: numeric.c =================================================================== --- numeric.c (revision 24761) +++ numeric.c (revision 24762) @@ -695,6 +695,13 @@ } } +/* + * call-seq: + * float.quo(numeric) -> float + * + * Returns float / numeric. + */ + static VALUE flo_quo(VALUE x, VALUE y) { @@ -2259,6 +2266,8 @@ if (modp) *modp = mod; } +VALUE rb_big_fdiv(VALUE x, VALUE y); + /* * call-seq: * fix.fdiv(numeric) -> float @@ -2271,8 +2280,6 @@ * */ -VALUE rb_big_fdiv(VALUE x, VALUE y); - static VALUE fix_fdiv(VALUE x, VALUE y) { @@ -3062,6 +3069,19 @@ return num; } +/* + * call-seq: + * num.round([ndigits]) -> integer or float + * + * Rounds <i>flt</i> to a given precision in decimal digits (default 0 digits). + * Precision may be negative. Returns a floating point number when +ndigits+ + * is positive, +self+ for zero, and round down for negative. + * + * 1.round #=> 1 + * 1.round(2) #=> 1.0 + * 15.round(-1) #=> 20 + */ + static VALUE int_round(int argc, VALUE* argv, VALUE num) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/