mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* numeric.c (flo_quo, int_round): added rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c76e698fd8
commit
ef2c92ddf0
1 changed files with 22 additions and 2 deletions
24
numeric.c
24
numeric.c
|
@ -695,6 +695,13 @@ flo_div(VALUE x, VALUE y)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* float.quo(numeric) -> float
|
||||
*
|
||||
* Returns float / numeric.
|
||||
*/
|
||||
|
||||
static VALUE
|
||||
flo_quo(VALUE x, VALUE y)
|
||||
{
|
||||
|
@ -2259,6 +2266,8 @@ fixdivmod(long x, long y, long *divp, long *modp)
|
|||
if (modp) *modp = mod;
|
||||
}
|
||||
|
||||
VALUE rb_big_fdiv(VALUE x, VALUE y);
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* fix.fdiv(numeric) -> float
|
||||
|
@ -2271,8 +2280,6 @@ fixdivmod(long x, long y, long *divp, long *modp)
|
|||
*
|
||||
*/
|
||||
|
||||
VALUE rb_big_fdiv(VALUE x, VALUE y);
|
||||
|
||||
static VALUE
|
||||
fix_fdiv(VALUE x, VALUE y)
|
||||
{
|
||||
|
@ -3062,6 +3069,19 @@ int_dotimes(VALUE num)
|
|||
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)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue